Class: Xasin::Telegram::OnMessage
- Inherits:
-
OnTelegramEvent
- Object
- OnTelegramEvent
- Xasin::Telegram::OnMessage
- Defined in:
- lib/xasin/telegram/OnMessage.rb
Instance Attribute Summary
Attributes inherited from OnTelegramEvent
Instance Method Summary collapse
-
#initialize(options) ⇒ OnMessage
constructor
A new instance of OnMessage.
- #nomp_message(message) ⇒ Object
Methods inherited from OnTelegramEvent
Constructor Details
#initialize(options) ⇒ OnMessage
Returns a new instance of OnMessage.
6 7 8 9 10 11 12 13 |
# File 'lib/xasin/telegram/OnMessage.rb', line 6 def initialize() super() @block = [:block] @regexp = [:regexp] @priority += 1 if @regexp end |
Instance Method Details
#nomp_message(message) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/xasin/telegram/OnMessage.rb', line 15 def () if @regexp match = @regexp.match .to_s if match @block.call , match .handled = true end else @block.call end end |