class Punchblock::Component::Output::Document

Constants

SSML_CONTENT_TYPE

Public Instance Methods

inherit(xml_node) click to toggle source
Calls superclass method
# File lib/punchblock/component/output.rb, line 25
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() click to toggle source
# File lib/punchblock/component/output.rb, line 37
def rayo_attributes
  {
    'url' => url,
    'content-type' => content_type
  }
end
rayo_children(root) click to toggle source
Calls superclass method
# File lib/punchblock/component/output.rb, line 44
def rayo_children(root)
  root.cdata xml_value
  super
end
size() click to toggle source
# File lib/punchblock/component/output.rb, line 49
def size
  if ssml?
    value.children.count
  else
    value.size
  end
end
ssml?() click to toggle source
# File lib/punchblock/component/output.rb, line 57
def ssml?
  content_type == SSML_CONTENT_TYPE
end

Private Instance Methods

urilist?() click to toggle source
# File lib/punchblock/component/output.rb, line 73
def urilist?
  content_type == 'text/uri-list'
end
xml_value() click to toggle source
# File lib/punchblock/component/output.rb, line 63
def xml_value
  if ssml?
    value.to_s
  elsif urilist?
    value.to_s
  elsif
    value
  end
end