Class: AlexaGenerator::SlotBinding

Inherits:
Object
  • Object
show all
Defined in:
lib/alexa_generator/slot_binding.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_nameObject (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

#valueObject (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