Class: Punchblock::Component::Input
- Inherits:
-
ComponentNode
- Object
- Niceogiri::XML::Node
- RayoNode
- Punchblock::CommandNode
- ComponentNode
- Punchblock::Component::Input
- Defined in:
- lib/punchblock/component/input.rb
Defined Under Namespace
Constant Summary
Constants inherited from RayoNode
Instance Attribute Summary
Attributes inherited from RayoNode
#client, #component_id, #connection, #domain, #original_component, #target_call_id, #target_mixer_name
Class Method Summary collapse
-
.new(options = {}) ⇒ Command::Input
Create a input command.
Instance Method Summary collapse
-
#grammar ⇒ Grammar
The grammar to activate.
- #grammar=(other) ⇒ Object
-
#initial_timeout ⇒ Integer
Indicates the amount of time preceding input which may expire before a timeout is triggered.
- #initial_timeout=(other) ⇒ Object
-
#inspect_attributes ⇒ Object
:nodoc:.
-
#inter_digit_timeout ⇒ Integer
Indicates (in the case of DTMF input) the amount of time between input digits which may expire before a timeout is triggered.
- #inter_digit_timeout=(other) ⇒ Object
-
#max_silence ⇒ Integer
The amount of time in milliseconds that an input command will wait until considered that a silence becomes a NO-MATCH.
- #max_silence=(other) ⇒ Object
-
#min_confidence ⇒ Float
Confidence with which to consider a response acceptable.
- #min_confidence=(min_confidence) ⇒ Object
-
#mode ⇒ Symbol
Mode by which to accept input.
- #mode=(mode) ⇒ Object
-
#recognizer ⇒ String
Recognizer to use for speech recognition.
- #recognizer=(recognizer) ⇒ Object
-
#sensitivity ⇒ Float
Indicates how sensitive the interpreter should be to loud versus quiet input.
- #sensitivity=(other) ⇒ Object
-
#terminator ⇒ String
Terminator by which to signal the end of input.
- #terminator=(terminator) ⇒ Object
Methods inherited from ComponentNode
#add_event, #complete_event, #complete_event=, #initialize, #register_event_handler, #register_internal_handlers, #response=, #stop!, #stop_action, #trigger_event_handler, #write_action
Methods inherited from Punchblock::CommandNode
#initialize, #response, #response=, #write_attr
Methods inherited from RayoNode
class_from_registration, #eql?, import, #inspect, register, #source
Constructor Details
This class inherits a constructor from Punchblock::Component::ComponentNode
Class Method Details
.new(options = {}) ⇒ Command::Input
Create a input command
34 35 36 37 38 |
# File 'lib/punchblock/component/input.rb', line 34 def self.new( = {}) super().tap do |new_node| .each_pair { |k,v| new_node.send :"#{k}=", v } end end |
Instance Method Details
#grammar ⇒ Grammar
Returns the grammar to activate.
155 156 157 158 |
# File 'lib/punchblock/component/input.rb', line 155 def grammar node = find_first 'ns:grammar', :ns => self.class.registered_ns Grammar.new node if node end |
#grammar=(other) ⇒ Object
166 167 168 169 170 171 |
# File 'lib/punchblock/component/input.rb', line 166 def grammar=(other) return unless other remove_children :grammar grammar = Grammar.new(other) unless other.is_a?(Grammar) self << grammar end |
#initial_timeout ⇒ Integer
Returns Indicates the amount of time preceding input which may expire before a timeout is triggered.
127 128 129 |
# File 'lib/punchblock/component/input.rb', line 127 def initial_timeout read_attr :'initial-timeout', :to_i end |
#initial_timeout=(other) ⇒ Object
134 135 136 |
# File 'lib/punchblock/component/input.rb', line 134 def initial_timeout=(other) write_attr :'initial-timeout', other end |
#inspect_attributes ⇒ Object
:nodoc:
173 174 175 |
# File 'lib/punchblock/component/input.rb', line 173 def inspect_attributes # :nodoc: [:mode, :terminator, :recognizer, :initial_timeout, :inter_digit_timeout, :sensitivity, :min_confidence, :grammar] + super end |
#inter_digit_timeout ⇒ Integer
Returns Indicates (in the case of DTMF input) the amount of time between input digits which may expire before a timeout is triggered.
141 142 143 |
# File 'lib/punchblock/component/input.rb', line 141 def inter_digit_timeout read_attr :'inter-digit-timeout', :to_i end |
#inter_digit_timeout=(other) ⇒ Object
148 149 150 |
# File 'lib/punchblock/component/input.rb', line 148 def inter_digit_timeout=(other) write_attr :'inter-digit-timeout', other end |
#max_silence ⇒ Integer
Returns the amount of time in milliseconds that an input command will wait until considered that a silence becomes a NO-MATCH.
43 44 45 |
# File 'lib/punchblock/component/input.rb', line 43 def max_silence read_attr :'max-silence', :to_i end |
#max_silence=(other) ⇒ Object
50 51 52 |
# File 'lib/punchblock/component/input.rb', line 50 def max_silence=(other) write_attr :'max-silence', other end |
#min_confidence ⇒ Float
Returns Confidence with which to consider a response acceptable.
57 58 59 |
# File 'lib/punchblock/component/input.rb', line 57 def min_confidence read_attr 'min-confidence', :to_f end |
#min_confidence=(min_confidence) ⇒ Object
64 65 66 |
# File 'lib/punchblock/component/input.rb', line 64 def min_confidence=(min_confidence) write_attr 'min-confidence', min_confidence end |
#mode ⇒ Symbol
Returns mode by which to accept input. Can be :speech, :dtmf or :any.
71 72 73 |
# File 'lib/punchblock/component/input.rb', line 71 def mode read_attr :mode, :to_sym end |
#mode=(mode) ⇒ Object
78 79 80 |
# File 'lib/punchblock/component/input.rb', line 78 def mode=(mode) write_attr :mode, mode end |
#recognizer ⇒ String
Returns recognizer to use for speech recognition.
85 86 87 |
# File 'lib/punchblock/component/input.rb', line 85 def recognizer read_attr :recognizer end |
#recognizer=(recognizer) ⇒ Object
92 93 94 |
# File 'lib/punchblock/component/input.rb', line 92 def recognizer=(recognizer) write_attr :recognizer, recognizer end |
#sensitivity ⇒ Float
Returns Indicates how sensitive the interpreter should be to loud versus quiet input. Higher values represent greater sensitivity.
113 114 115 |
# File 'lib/punchblock/component/input.rb', line 113 def sensitivity read_attr :sensitivity, :to_f end |
#sensitivity=(other) ⇒ Object
120 121 122 |
# File 'lib/punchblock/component/input.rb', line 120 def sensitivity=(other) write_attr :sensitivity, other end |
#terminator ⇒ String
Returns terminator by which to signal the end of input.
99 100 101 |
# File 'lib/punchblock/component/input.rb', line 99 def terminator read_attr :terminator end |
#terminator=(terminator) ⇒ Object
106 107 108 |
# File 'lib/punchblock/component/input.rb', line 106 def terminator=(terminator) write_attr :terminator, terminator end |