Class: TelegramWebProxy
- Inherits:
-
Object
- Object
- TelegramWebProxy
- Defined in:
- lib/telegram_web_proxy.rb,
lib/telegram_web_proxy/version.rb
Overview
WebProxy for a Telegram bot which handles chats and process messages
Constant Summary collapse
- VERSION =
'0.2.0'
Instance Attribute Summary collapse
-
#bot ⇒ Object
Returns the value of attribute bot.
Instance Method Summary collapse
-
#initialize(bot) ⇒ TelegramWebProxy
constructor
A new instance of TelegramWebProxy.
- #message_processors ⇒ Object
- #process(message) ⇒ Object
Constructor Details
#initialize(bot) ⇒ TelegramWebProxy
Returns a new instance of TelegramWebProxy.
12 13 14 |
# File 'lib/telegram_web_proxy.rb', line 12 def initialize(bot) self.bot = bot end |
Instance Attribute Details
#bot ⇒ Object
Returns the value of attribute bot.
10 11 12 |
# File 'lib/telegram_web_proxy.rb', line 10 def bot @bot end |
Instance Method Details
#message_processors ⇒ Object
16 17 18 |
# File 'lib/telegram_web_proxy.rb', line 16 def @message_processors ||= {} end |
#process(message) ⇒ Object
20 21 22 23 24 |
# File 'lib/telegram_web_proxy.rb', line 20 def process() chat = get_chat() [chat.id] ||= MessageProcessor.new(bot, chat) [chat.id].process() end |