Class: AlexaRuby::Slot

Inherits:
Object
  • Object
show all
Defined in:
lib/alexa_ruby/request/intent_request/slot.rb

Overview

Class that encapsulates each slot

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(slot) ⇒ Slot

Initialize slot and define its name and value

Raises:

  • (ArgumentError)

9
10
11
12
13
14
15
# File 'lib/alexa_ruby/request/intent_request/slot.rb', line 9

def initialize(slot)
  @slot = slot
  raise ArgumentError, 'Missing slot parameters' if invalid_slot?
  @name = @slot[:name]
  @value = @slot[:value]
  @confirmation_status = define_confirmation_status
end

Instance Attribute Details

#confirmation_statusObject

Returns the value of attribute confirmation_status


4
5
6
# File 'lib/alexa_ruby/request/intent_request/slot.rb', line 4

def confirmation_status
  @confirmation_status
end

#nameObject

Returns the value of attribute name


4
5
6
# File 'lib/alexa_ruby/request/intent_request/slot.rb', line 4

def name
  @name
end

#valueObject

Returns the value of attribute value


4
5
6
# File 'lib/alexa_ruby/request/intent_request/slot.rb', line 4

def value
  @value
end