class AlexaSkill::IntentBuilder

Attributes

card_response[R]
response[R]
slots[R]
utterances[R]

Public Class Methods

build(builder) click to toggle source
# File lib/alexa-skill/intent_builder.rb, line 28
def self.build(builder)
  intent = AlexaSkill::Intent.new
  intent.slots      = builder.slots
  intent.utterances = builder.utterances
  intent.response   = builder.response
  intent.card       = builder.card_response
  intent
end
new(&block) click to toggle source
# File lib/alexa-skill/intent_builder.rb, line 6
def initialize(&block)
  @slots = {}
  @utterances = []
  self.instance_eval(&block)
end

Public Instance Methods

card(&block) click to toggle source
# File lib/alexa-skill/intent_builder.rb, line 16
def card(&block)
  @card_response = block
end
respond(&block) click to toggle source
# File lib/alexa-skill/intent_builder.rb, line 20
def respond(&block)
  @response = block
end
slot(name, options=[]) click to toggle source
# File lib/alexa-skill/intent_builder.rb, line 12
def slot(name, options=[])
  @slots[name] = options
end
utterance(value) click to toggle source
# File lib/alexa-skill/intent_builder.rb, line 24
def utterance(value)
  @utterances << value
end