class VkLongpollBot::Events::EventListener

Class containing block to run on some event.

Attributes

subtype[R]

@return [String] subtype of this listener.

Public Class Methods

new(options, &block) click to toggle source

Initialize new listener

@param options

@option options [String] subtype

@yieldparam event [Event]

# File lib/vk_longpoll_bot/events.rb, line 96
def initialize(options, &block)
  @subtype = options[:subtype]
  @block = block
end

Public Instance Methods

call(event) click to toggle source

Calls block with given event as argument.

@param event [Event]

@return [void]

# File lib/vk_longpoll_bot/events.rb, line 107
def call(event)
  @block.call(event)
end