Class: VkLongpollBot::Events::EventListener
- Inherits:
-
Object
- Object
- VkLongpollBot::Events::EventListener
- Defined in:
- lib/vk_longpoll_bot/events.rb
Overview
Class containing block to run on some event.
Instance Attribute Summary collapse
-
#subtype ⇒ Object
readonly
Returns the value of attribute subtype.
Instance Method Summary collapse
- #call(event) ⇒ Object
-
#initialize(attributes, &block) ⇒ EventListener
constructor
A new instance of EventListener.
Constructor Details
#initialize(attributes, &block) ⇒ EventListener
Returns a new instance of EventListener.
55 56 57 58 59 60 |
# File 'lib/vk_longpoll_bot/events.rb', line 55 def initialize(attributes, &block) @subtype = attributes[:subtype] @block = block # TODO end |
Instance Attribute Details
#subtype ⇒ Object (readonly)
Returns the value of attribute subtype.
53 54 55 |
# File 'lib/vk_longpoll_bot/events.rb', line 53 def subtype @subtype end |
Instance Method Details
#call(event) ⇒ Object
62 63 64 |
# File 'lib/vk_longpoll_bot/events.rb', line 62 def call(event) @block.call(event) end |