Class: CampfireBot::Event::Time
Instance Attribute Summary
Attributes inherited from EventHandler
#kind, #matcher, #method, #plugin
Instance Method Summary
collapse
handles
Constructor Details
#initialize(*args) ⇒ 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
|