Class: TelegramBot::EventHandler::Handler

Inherits:
Object
  • Object
show all
Defined in:
lib/telegram_bot/handler.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(matcher, action, pass) ⇒ Handler

Returns a new instance of Handler.



12
13
14
15
16
# File 'lib/telegram_bot/handler.rb', line 12

def initialize(matcher, action, pass)
  @matcher = matcher
  @action  = action
  @pass    = pass
end

Instance Attribute Details

#actionObject

Returns the value of attribute action.



10
11
12
# File 'lib/telegram_bot/handler.rb', line 10

def action
  @action
end

#matcherObject

Returns the value of attribute matcher.



10
11
12
# File 'lib/telegram_bot/handler.rb', line 10

def matcher
  @matcher
end

#passObject

Returns the value of attribute pass.



10
11
12
# File 'lib/telegram_bot/handler.rb', line 10

def pass
  @pass
end

Instance Method Details

#===(msg) ⇒ Object



22
23
24
# File 'lib/telegram_bot/handler.rb', line 22

def ===(msg)
  @matcher === msg
end

#arguments(msg) ⇒ Object



26
27
28
# File 'lib/telegram_bot/handler.rb', line 26

def arguments(msg)
  @matcher.arguments(msg)
end

#pass?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/telegram_bot/handler.rb', line 18

def pass?
  @pass
end