Class: Ralyxa::Handler
- Inherits:
-
Object
- Object
- Ralyxa::Handler
- Defined in:
- lib/ralyxa/handler.rb
Instance Method Summary collapse
- #audio_player ⇒ Object
- #card(title, body, image_url = nil, card_class = Ralyxa::ResponseEntities::Card) ⇒ Object
- #handle ⇒ Object
-
#initialize(request) ⇒ Handler
constructor
A new instance of Handler.
- #link_account_card(card_class = Ralyxa::ResponseEntities::Card) ⇒ Object
- #log(level, message) ⇒ Object
Constructor Details
#initialize(request) ⇒ Handler
Returns a new instance of Handler.
7 8 9 |
# File 'lib/ralyxa/handler.rb', line 7 def initialize(request) @request = request end |
Instance Method Details
#audio_player ⇒ Object
30 31 32 |
# File 'lib/ralyxa/handler.rb', line 30 def audio_player Ralyxa::ResponseEntities::Directives::AudioPlayer end |
#card(title, body, image_url = nil, card_class = Ralyxa::ResponseEntities::Card) ⇒ Object
26 27 28 |
# File 'lib/ralyxa/handler.rb', line 26 def card(title, body, image_url = nil, card_class = Ralyxa::ResponseEntities::Card) card_class.as_hash(title, body, image_url) end |
#handle ⇒ Object
11 12 13 |
# File 'lib/ralyxa/handler.rb', line 11 def handle raise NotImplementedError end |
#link_account_card(card_class = Ralyxa::ResponseEntities::Card) ⇒ Object
34 35 36 |
# File 'lib/ralyxa/handler.rb', line 34 def link_account_card(card_class = Ralyxa::ResponseEntities::Card) card_class.link_account end |
#log(level, message) ⇒ Object
38 39 40 |
# File 'lib/ralyxa/handler.rb', line 38 def log(level, ) puts "[#{Time.new}] [#{@request.user_id}] #{level} - #{}" end |