Class: Ralyxa::Handler

Inherits:
Object
  • Object
show all
Defined in:
lib/ralyxa/handler.rb

Instance Method Summary collapse

Constructor Details

#initialize(request, intent_proc) ⇒ Handler

Returns a new instance of Handler.



6
7
8
9
# File 'lib/ralyxa/handler.rb', line 6

def initialize(request, intent_proc)
  @request     = request
  @intent_proc = intent_proc
end

Instance Method Details

#card(title, body, image_url = nil, card_class = Ralyxa::Card) ⇒ Object



23
24
25
# File 'lib/ralyxa/handler.rb', line 23

def card(title, body, image_url = nil, card_class = Ralyxa::Card)
  card_class.as_hash(title, body, image_url)
end

#handleObject



11
12
13
# File 'lib/ralyxa/handler.rb', line 11

def handle
  instance_eval &@intent_proc
end