Class: EhbrsRubyUtils::Gjt1::Manager
- Inherits:
-
Object
- Object
- EhbrsRubyUtils::Gjt1::Manager
- Includes:
- Singleton
- Defined in:
- lib/ehbrs_ruby_utils/gjt1/manager.rb
Instance Method Summary collapse
- #bga_game_statistics_notify(game_statistics) ⇒ void
-
#new_bga_session ⇒ EhbrsRubyUtils::Bga::Session
Cria uma nova sessão BGA.
- #on_bga_logged_session(&block) ⇒ Object
- #whatsapp_send(message, image_path = nil) ⇒ void
Instance Method Details
#bga_game_statistics_notify(game_statistics) ⇒ void
This method returns an undefined value.
28 29 30 31 32 |
# File 'lib/ehbrs_ruby_utils/gjt1/manager.rb', line 28 def bga_game_statistics_notify(game_statistics) whatsapp_formatter_send( ::EhbrsRubyUtils::Bga::GameStatistics::WhatsappFormatter, game_statistics ) end |
#new_bga_session ⇒ EhbrsRubyUtils::Bga::Session
Returns Cria uma nova sessão BGA.
45 46 47 |
# File 'lib/ehbrs_ruby_utils/gjt1/manager.rb', line 45 def new_bga_session ::EhbrsRubyUtils::Bga::Session.new(bga_username, bga_password) end |
#on_bga_logged_session(&block) ⇒ Object
34 35 36 37 38 39 40 41 42 |
# File 'lib/ehbrs_ruby_utils/gjt1/manager.rb', line 34 def on_bga_logged_session(&block) bga_session = new_bga_session begin bga_session.on_logged { block.call(bga_session) } ensure bga_session.close bga_session = nil end end |
#whatsapp_send(message, image_path = nil) ⇒ void
This method returns an undefined value.
52 53 54 55 |
# File 'lib/ehbrs_ruby_utils/gjt1/manager.rb', line 52 def whatsapp_send(, image_path = nil) ::EhbrsRubyUtils::Mudslide::Message.new.text().image_path(image_path) .recipient(whatsapp_recipient).deliver end |