Class: Punchblock::Component::Output::Document
- Defined in:
- lib/punchblock/component/output.rb
Constant Summary collapse
- SSML_CONTENT_TYPE =
'application/ssml+xml'
Instance Attribute Summary
Attributes inherited from RayoNode
#client, #connection, #original_component
Instance Method Summary collapse
-
#content_type ⇒ String
The document content type.
- #inherit(xml_node) ⇒ Object
- #rayo_attributes ⇒ Object
- #rayo_children(root) ⇒ Object
-
#url ⇒ String
The URL from which the fetch the grammar.
-
#value ⇒ String, ...
The document.
Methods inherited from RayoNode
#==, class_from_registration, from_xml, #inspect, register, #source, #to_rayo, #to_xml
Instance Method Details
#content_type ⇒ String
Returns the document content type.
17 |
# File 'lib/punchblock/component/output.rb', line 17 attribute :content_type, String, default: ->(grammar, attribute) { grammar.url ? nil : SSML_CONTENT_TYPE } |
#inherit(xml_node) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/punchblock/component/output.rb', line 22 def inherit(xml_node) super self.value = if ssml? RubySpeech::SSML.import xml_node.content elsif urilist? URIList.import xml_node.content else xml_node.content end self end |
#rayo_attributes ⇒ Object
34 35 36 37 38 39 |
# File 'lib/punchblock/component/output.rb', line 34 def rayo_attributes { 'url' => url, 'content-type' => content_type } end |
#rayo_children(root) ⇒ Object
41 42 43 44 |
# File 'lib/punchblock/component/output.rb', line 41 def rayo_children(root) root.cdata xml_value super end |
#url ⇒ String
Returns the URL from which the fetch the grammar.
14 |
# File 'lib/punchblock/component/output.rb', line 14 attribute :url |
#value ⇒ String, ...
Returns the document.
20 |
# File 'lib/punchblock/component/output.rb', line 20 attribute :value |