Class: AlexaRubykit::Slot
- Inherits:
-
Object
- Object
- AlexaRubykit::Slot
- Defined in:
- lib/alexa_rubykit/intent_request.rb
Overview
Class that encapsulates each slot.
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(name, value) ⇒ Slot
constructor
Each slot has a name and a value.
-
#to_s ⇒ Object
For better testing.
Constructor Details
#initialize(name, value) ⇒ Slot
Each slot has a name and a value.
48 49 50 51 52 |
# File 'lib/alexa_rubykit/intent_request.rb', line 48 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
#name ⇒ Object
Returns the value of attribute name.
45 46 47 |
# File 'lib/alexa_rubykit/intent_request.rb', line 45 def name @name end |
#value ⇒ Object
Returns the value of attribute value.
45 46 47 |
# File 'lib/alexa_rubykit/intent_request.rb', line 45 def value @value end |
Instance Method Details
#to_s ⇒ Object
For better testing.
55 56 57 |
# File 'lib/alexa_rubykit/intent_request.rb', line 55 def to_s "Slot Name: #{@name}, Value: #{value}" end |