Class: Capistrano::Telegram

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/capistrano/telegram.rb

Instance Method Summary collapse

Constructor Details

#initialize(env) ⇒ Telegram

Returns a new instance of Telegram.



13
14
15
16
17
# File 'lib/capistrano/telegram.rb', line 13

def initialize(env)
  @telegram_bot_key = fetch(:telegram_bot_key, nil)
  @telegram_chat_id = fetch(:telegram_chat_id, nil)
  @message = Capistrano::Messaging::Telegram.new
end

Instance Method Details

#send(action) ⇒ Object



19
20
21
22
# File 'lib/capistrano/telegram.rb', line 19

def send(action)
  payload = @message.payload_for(action)
  send_to_telegram(payload)
end