Class: AlexaModelMd::Intent
- Inherits:
-
Object
- Object
- AlexaModelMd::Intent
- Defined in:
- lib/alexa_modelmd.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#utterances ⇒ Object
readonly
Returns the value of attribute utterances.
Instance Method Summary collapse
-
#initialize(s) ⇒ Intent
constructor
A new instance of Intent.
Constructor Details
#initialize(s) ⇒ Intent
Returns a new instance of Intent.
18 19 20 21 22 23 24 25 26 |
# File 'lib/alexa_modelmd.rb', line 18 def initialize(s) doc = Rexle.new("<root9>%s</root9>" % \ Kramdown::Document.new(Martile.new(s).to_s).to_html) @name = doc.root.element('h2/text()').to_s @utterances = doc.root.xpath('ul/li/text()').map(&:to_s) @code = doc.root.element('//code/text()').to_s end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
16 17 18 |
# File 'lib/alexa_modelmd.rb', line 16 def code @code end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
16 17 18 |
# File 'lib/alexa_modelmd.rb', line 16 def name @name end |
#utterances ⇒ Object (readonly)
Returns the value of attribute utterances.
16 17 18 |
# File 'lib/alexa_modelmd.rb', line 16 def utterances @utterances end |