Class: Eventception::ListenerHandler
- Inherits:
-
Object
- Object
- Eventception::ListenerHandler
- Defined in:
- lib/eventception/listener_handler.rb
Instance Attribute Summary collapse
-
#listener ⇒ Object
readonly
Returns the value of attribute listener.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #call(event) ⇒ Object
- #eql?(other) ⇒ Boolean
-
#initialize(listener, method) ⇒ ListenerHandler
constructor
A new instance of ListenerHandler.
Constructor Details
#initialize(listener, method) ⇒ ListenerHandler
Returns a new instance of ListenerHandler
25 26 27 28 |
# File 'lib/eventception/listener_handler.rb', line 25 def initialize(listener, method) @listener = listener @method = method end |
Instance Attribute Details
#listener ⇒ Object (readonly)
Returns the value of attribute listener
22 23 24 |
# File 'lib/eventception/listener_handler.rb', line 22 def listener @listener end |
#method ⇒ Object (readonly)
Returns the value of attribute method
23 24 25 |
# File 'lib/eventception/listener_handler.rb', line 23 def method @method end |
Instance Method Details
#==(other) ⇒ Object
34 35 36 |
# File 'lib/eventception/listener_handler.rb', line 34 def ==(other) eql?(other) end |
#call(event) ⇒ Object
30 31 32 |
# File 'lib/eventception/listener_handler.rb', line 30 def call(event) listener.public_send(method, event) end |
#eql?(other) ⇒ Boolean
38 39 40 |
# File 'lib/eventception/listener_handler.rb', line 38 def eql?(other) listener == other.listener && method == other.method end |