Class: CampfireBot::Event::Time
- Inherits:
-
EventHandler
- Object
- EventHandler
- CampfireBot::Event::Time
- Defined in:
- lib/event.rb
Instance Attribute Summary
Attributes inherited from EventHandler
#kind, #matcher, #method, #plugin
Instance Method Summary collapse
-
#initialize(*args) ⇒ Time
constructor
A new instance of Time.
- #match? ⇒ Boolean
- #run(force = false) ⇒ Object
Methods inherited from EventHandler
Constructor Details
#initialize(*args) ⇒ Time
Returns a new instance of Time.
95 96 97 98 |
# File 'lib/event.rb', line 95 def initialize(*args) @run = false super(*args) end |
Instance Method Details
#match? ⇒ Boolean
100 101 102 |
# File 'lib/event.rb', line 100 def match? @matcher <= ::Time.now && !@run end |
#run(force = false) ⇒ Object
104 105 106 107 108 109 110 111 |
# File 'lib/event.rb', line 104 def run(force = false) if match? @run = true Plugin.registered_plugins[@plugin].send(@method) else false end end |