class Punchblock::Component::Input

Constants

NLSML_NAMESPACE

Public Instance Methods

grammar=(other) click to toggle source

@param [Hash] other @option other [String] :content_type the document content type @option other [String] :value the grammar doucment @option other [String] :url the url from which to fetch the grammar

# File lib/punchblock/component/input.rb, line 54
def grammar=(other)
  self.grammars = [other].compact
end
grammars=(others) click to toggle source
Calls superclass method
# File lib/punchblock/component/input.rb, line 44
def grammars=(others)
  super others.map { |other| Grammar.new(other) }
end
inherit(xml_node) click to toggle source
Calls superclass method Punchblock::HasHeaders#inherit
# File lib/punchblock/component/input.rb, line 58
def inherit(xml_node)
  grammar_nodes = xml_node.xpath('ns:grammar', ns: self.class.registered_ns)
  self.grammars = grammar_nodes.to_a.map { |grammar_node| Grammar.from_xml(grammar_node)}
  super
end
rayo_attributes() click to toggle source
# File lib/punchblock/component/input.rb, line 64
def rayo_attributes
  {
    'max-silence' => max_silence,
    'min-confidence' => min_confidence,
    'mode' => mode,
    'recognizer' => recognizer,
    'language' => language,
    'terminator' => terminator,
    'sensitivity' => sensitivity,
    'initial-timeout' => initial_timeout,
    'inter-digit-timeout' => inter_digit_timeout,
    'recognition-timeout' => recognition_timeout
  }
end
rayo_children(root) click to toggle source
Calls superclass method Punchblock::HasHeaders#rayo_children
# File lib/punchblock/component/input.rb, line 79
def rayo_children(root)
  grammars.each do |grammar|
    grammar.to_rayo(root)
  end
  super
end