hisham
public ruby v1 · immutableclass Timers def initialize methods.grep /^timer_(\d+)/ do |m| puts "found timer to add, [:meth => #{m}, :delay => #{$1}]" # [TODO] hook up timer and delay into main event loop. self.send m end endendclass MyTimers < Timers # Add a timer that will tick every 4 seconds def timer_4 puts "timer 1" end # Add a timer that will tick every 2 seconds def timer_2 puts "timer 2" endendt = MyTimers.new