Class: VkLongpollBot::Events::EventListener

Inherits:
Object
  • Object
show all
Defined in:
lib/vk_longpoll_bot/events.rb

Overview

Class containing block to run on some event.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#subtypeObject (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