Class: AlexaGenerator::SampleUtteranceTemplate

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#templateObject (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_slotsObject



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