Class: TelegramWebProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/telegram_web_proxy.rb,
lib/telegram_web_proxy/version.rb

Defined Under Namespace

Classes: KeyboardGenerator, MessageProcessor, PageFetcher

Constant Summary collapse

VERSION =
"0.1.0"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bot) ⇒ TelegramWebProxy

Returns a new instance of TelegramWebProxy.



9
10
11
# File 'lib/telegram_web_proxy.rb', line 9

def initialize(bot)
  self.bot = bot
end

Instance Attribute Details

#botObject

Returns the value of attribute bot.



7
8
9
# File 'lib/telegram_web_proxy.rb', line 7

def bot
  @bot
end

Instance Method Details

#message_processorsObject



13
14
15
# File 'lib/telegram_web_proxy.rb', line 13

def message_processors
  @message_processors ||= {}
end

#process(message) ⇒ Object



17
18
19
20
21
# File 'lib/telegram_web_proxy.rb', line 17

def process(message)
  chat = get_chat(message)
  message_processors[chat.id] ||= MessageProcessor.new(bot, chat)
  message_processors[chat.id].process(message)
end