Class: AlexaRubykit::Slot

Inherits:
Object
  • Object
show all
Defined in:
lib/alexa_rubykit/intent_request.rb

Overview

Class that encapsulates each slot.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, value) ⇒ Slot

Each slot has a name and a value.

Raises:

  • (ArgumentError)

49
50
51
52
53
# File 'lib/alexa_rubykit/intent_request.rb', line 49

def initialize(name, value)
  raise ArgumentError, 'Need a name and a value' if name.nil? || value.nil?
  @name = name
  @value = value
end

Instance Attribute Details

#nameObject

Returns the value of attribute name


46
47
48
# File 'lib/alexa_rubykit/intent_request.rb', line 46

def name
  @name
end

#valueObject

Returns the value of attribute value


46
47
48
# File 'lib/alexa_rubykit/intent_request.rb', line 46

def value
  @value
end

Instance Method Details

#to_sObject

Outputs Slot name and value.


56
57
58
# File 'lib/alexa_rubykit/intent_request.rb', line 56

def to_s
  "Slot Name: #{name}, Value: #{value}"
end