Class: AlexaGenerator::SampleUtteranceTemplate
- Inherits:
-
Object
- Object
- AlexaGenerator::SampleUtteranceTemplate
- Defined in:
- lib/alexa_generator/sample_utterance_template.rb
Instance Attribute Summary collapse
-
#intent_name ⇒ Object
readonly
Returns the value of attribute intent_name.
-
#template ⇒ Object
readonly
Returns the value of attribute template.
Instance Method Summary collapse
-
#initialize(intent_name, template) ⇒ SampleUtteranceTemplate
constructor
A new instance of SampleUtteranceTemplate.
- #referenced_slots ⇒ Object
Constructor Details
#initialize(intent_name, template) ⇒ SampleUtteranceTemplate
Returns a new instance of SampleUtteranceTemplate.
5 6 7 8 |
# File 'lib/alexa_generator/sample_utterance_template.rb', line 5 def initialize(intent_name, template) @intent_name = intent_name @template = template end |
Instance Attribute Details
#intent_name ⇒ Object (readonly)
Returns the value of attribute intent_name.
3 4 5 |
# File 'lib/alexa_generator/sample_utterance_template.rb', line 3 def intent_name @intent_name end |
#template ⇒ Object (readonly)
Returns the value of attribute template.
3 4 5 |
# File 'lib/alexa_generator/sample_utterance_template.rb', line 3 def template @template end |
Instance Method Details
#referenced_slots ⇒ Object
10 11 12 |
# File 'lib/alexa_generator/sample_utterance_template.rb', line 10 def referenced_slots template.scan( /\{([a-z]+)\}/i ).map(&:first).map(&:to_sym) end |