Class: TelegramMeetupBot::Messenger
- Inherits:
-
Object
- Object
- TelegramMeetupBot::Messenger
- Defined in:
- lib/telegram_meetup_bot/messenger.rb
Instance Attribute Summary collapse
-
#api ⇒ Object
readonly
Returns the value of attribute api.
-
#chat_id ⇒ Object
readonly
Returns the value of attribute chat_id.
Instance Method Summary collapse
-
#initialize(args) ⇒ Messenger
constructor
A new instance of Messenger.
- #send_text(text) ⇒ Object
Constructor Details
#initialize(args) ⇒ Messenger
Returns a new instance of Messenger.
5 6 7 8 |
# File 'lib/telegram_meetup_bot/messenger.rb', line 5 def initialize(args) @api = args.fetch(:api) @chat_id = args.fetch(:chat_id) end |
Instance Attribute Details
#api ⇒ Object (readonly)
Returns the value of attribute api.
3 4 5 |
# File 'lib/telegram_meetup_bot/messenger.rb', line 3 def api @api end |
#chat_id ⇒ Object (readonly)
Returns the value of attribute chat_id.
3 4 5 |
# File 'lib/telegram_meetup_bot/messenger.rb', line 3 def chat_id @chat_id end |
Instance Method Details
#send_text(text) ⇒ Object
10 11 12 |
# File 'lib/telegram_meetup_bot/messenger.rb', line 10 def send_text(text) api.(chat_id: chat_id, text: text, reply_markup: keyboard) end |