Class: AlexaGenerator::SlotBinding
- Inherits:
-
Object
- Object
- AlexaGenerator::SlotBinding
- Defined in:
- lib/alexa_generator/slot_binding.rb
Instance Attribute Summary collapse
-
#slot_name ⇒ Object
readonly
Returns the value of attribute slot_name.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #bind_to_template!(template) ⇒ Object
-
#initialize(slot_name, value) ⇒ SlotBinding
constructor
A new instance of SlotBinding.
Constructor Details
#initialize(slot_name, value) ⇒ SlotBinding
Returns a new instance of SlotBinding.
5 6 7 8 |
# File 'lib/alexa_generator/slot_binding.rb', line 5 def initialize(slot_name, value) @slot_name = slot_name @value = value end |
Instance Attribute Details
#slot_name ⇒ Object (readonly)
Returns the value of attribute slot_name.
3 4 5 |
# File 'lib/alexa_generator/slot_binding.rb', line 3 def slot_name @slot_name end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
3 4 5 |
# File 'lib/alexa_generator/slot_binding.rb', line 3 def value @value end |
Instance Method Details
#bind_to_template!(template) ⇒ Object
10 11 12 |
# File 'lib/alexa_generator/slot_binding.rb', line 10 def bind_to_template!(template) template.gsub! "{#{slot_name}}", "{#{value}|#{slot_name}}" end |