Class: Flirt::Callback
- Inherits:
-
Object
- Object
- Flirt::Callback
- Defined in:
- lib/flirt/callback.rb
Instance Attribute Summary collapse
-
#callback_name ⇒ Object
Returns the value of attribute callback_name.
-
#object ⇒ Object
Returns the value of attribute object.
Instance Method Summary collapse
- #==(other_callback) ⇒ Object
- #call(event_data) ⇒ Object
-
#initialize(opts = {}) ⇒ Callback
constructor
A new instance of Callback.
Constructor Details
#initialize(opts = {}) ⇒ Callback
Returns a new instance of Callback.
10 11 12 13 |
# File 'lib/flirt/callback.rb', line 10 def initialize(opts = {}) self.callback_name = opts.fetch(:callback_name) self.object = opts.fetch(:object) end |
Instance Attribute Details
#callback_name ⇒ Object
Returns the value of attribute callback_name.
8 9 10 |
# File 'lib/flirt/callback.rb', line 8 def callback_name @callback_name end |
#object ⇒ Object
Returns the value of attribute object.
8 9 10 |
# File 'lib/flirt/callback.rb', line 8 def object @object end |
Instance Method Details
#==(other_callback) ⇒ Object
21 22 23 |
# File 'lib/flirt/callback.rb', line 21 def ==(other_callback) object == other_callback.object && callback_name == other_callback.callback_name end |
#call(event_data) ⇒ Object
16 17 18 |
# File 'lib/flirt/callback.rb', line 16 def call(event_data) object.send callback_name, event_data end |