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.
6 7 8 9 |
# File 'lib/eventception/listener_handler.rb', line 6 def initialize(listener, method) @listener = listener @method = method end |
Instance Attribute Details
#listener ⇒ Object (readonly)
Returns the value of attribute listener.
3 4 5 |
# File 'lib/eventception/listener_handler.rb', line 3 def listener @listener end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
4 5 6 |
# File 'lib/eventception/listener_handler.rb', line 4 def method @method end |
Instance Method Details
#==(other) ⇒ Object
15 16 17 |
# File 'lib/eventception/listener_handler.rb', line 15 def ==(other) eql?(other) end |
#call(event) ⇒ Object
11 12 13 |
# File 'lib/eventception/listener_handler.rb', line 11 def call(event) listener.public_send(method, event) end |
#eql?(other) ⇒ Boolean
19 20 21 |
# File 'lib/eventception/listener_handler.rb', line 19 def eql?(other) listener == other.listener && method == other.method end |