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
Instance Attribute Summary
Attributes inherited from RayoNode
#call_id, #client, #component_id, #connection, #domain, #mixer_name, #original_component
Class Method Summary collapse
-
.new(options = {}) ⇒ Command::Input
Create an input message.
Instance Method Summary collapse
-
#complete_timeout ⇒ Integer
Timeout to wait for user input.
- #complete_timeout=(other) ⇒ Object
-
#grammar ⇒ Choices
The choices available.
- #grammar=(other) ⇒ Object
-
#incomplete_timeout ⇒ Integer
Timeout to wait for user input.
- #incomplete_timeout=(other) ⇒ Object
-
#initial_timeout ⇒ Integer
Timeout to wait for user input.
- #initial_timeout=(other) ⇒ Object
-
#inspect_attributes ⇒ Object
:nodoc:.
-
#inter_digit_timeout ⇒ Integer
Timeout to wait for user input.
- #inter_digit_timeout=(other) ⇒ Object
-
#max_digits ⇒ Boolean
Wether or not to allow the caller to begin their response before the prompt finishes.
- #max_digits=(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 ⇒ Integer
Timeout to wait for user input.
- #sensitivity=(other) ⇒ Object
-
#term_timeout ⇒ Integer
Timeout to wait for user input.
- #term_timeout=(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 an input message
33 34 35 36 37 |
# File 'lib/punchblock/component/input.rb', line 33 def self.new( = {}) super().tap do |new_node| .each_pair { |k,v| new_node.send :"#{k}=", v } end end |
Instance Method Details
#complete_timeout ⇒ Integer
Returns timeout to wait for user input.
182 183 184 |
# File 'lib/punchblock/component/input.rb', line 182 def complete_timeout read_attr :'complete-timeout', :to_i end |
#complete_timeout=(other) ⇒ Object
189 190 191 |
# File 'lib/punchblock/component/input.rb', line 189 def complete_timeout=(other) write_attr :'complete-timeout', other end |
#grammar ⇒ Choices
Returns the choices available.
210 211 212 213 |
# File 'lib/punchblock/component/input.rb', line 210 def grammar node = find_first 'ns:grammar', :ns => self.class.registered_ns Grammar.new node if node end |
#grammar=(other) ⇒ Object
220 221 222 223 224 225 |
# File 'lib/punchblock/component/input.rb', line 220 def grammar=(other) return unless other remove_children :grammar grammar = Grammar.new(other) unless other.is_a?(Grammar) self << grammar end |
#incomplete_timeout ⇒ Integer
Returns timeout to wait for user input.
196 197 198 |
# File 'lib/punchblock/component/input.rb', line 196 def incomplete_timeout read_attr :'incomplete-timeout', :to_i end |
#incomplete_timeout=(other) ⇒ Object
203 204 205 |
# File 'lib/punchblock/component/input.rb', line 203 def incomplete_timeout=(other) write_attr :'incomplete-timeout', other end |
#initial_timeout ⇒ Integer
Returns timeout to wait for user input.
140 141 142 |
# File 'lib/punchblock/component/input.rb', line 140 def initial_timeout read_attr :'initial-timeout', :to_i end |
#initial_timeout=(other) ⇒ Object
147 148 149 |
# File 'lib/punchblock/component/input.rb', line 147 def initial_timeout=(other) write_attr :'initial-timeout', other end |
#inspect_attributes ⇒ Object
:nodoc:
227 228 229 |
# File 'lib/punchblock/component/input.rb', line 227 def inspect_attributes # :nodoc: [:mode, :terminator, :max_digits, :recognizer, :initial_timeout, :inter_digit_timeout, :term_timeout, :complete_timeout, :incomplete_timeout, :sensitivity, :min_confidence, :grammar] + super end |
#inter_digit_timeout ⇒ Integer
Returns timeout to wait for user input.
154 155 156 |
# File 'lib/punchblock/component/input.rb', line 154 def inter_digit_timeout read_attr :'inter-digit-timeout', :to_i end |
#inter_digit_timeout=(other) ⇒ Object
161 162 163 |
# File 'lib/punchblock/component/input.rb', line 161 def inter_digit_timeout=(other) write_attr :'inter-digit-timeout', other end |
#max_digits ⇒ Boolean
Returns wether or not to allow the caller to begin their response before the prompt finishes.
42 43 44 |
# File 'lib/punchblock/component/input.rb', line 42 def max_digits read_attr :'max-digits', :to_i end |
#max_digits=(other) ⇒ Object
49 50 51 |
# File 'lib/punchblock/component/input.rb', line 49 def max_digits=(other) write_attr :'max-digits', 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.
56 57 58 |
# File 'lib/punchblock/component/input.rb', line 56 def max_silence read_attr :'max-silence', :to_i end |
#max_silence=(other) ⇒ Object
63 64 65 |
# File 'lib/punchblock/component/input.rb', line 63 def max_silence=(other) write_attr :'max-silence', other end |
#min_confidence ⇒ Float
Returns Confidence with which to consider a response acceptable.
70 71 72 |
# File 'lib/punchblock/component/input.rb', line 70 def min_confidence read_attr 'min-confidence', :to_f end |
#min_confidence=(min_confidence) ⇒ Object
77 78 79 |
# File 'lib/punchblock/component/input.rb', line 77 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.
84 85 86 |
# File 'lib/punchblock/component/input.rb', line 84 def mode read_attr :mode, :to_sym end |
#mode=(mode) ⇒ Object
91 92 93 |
# File 'lib/punchblock/component/input.rb', line 91 def mode=(mode) write_attr :mode, mode end |
#recognizer ⇒ String
Returns recognizer to use for speech recognition.
98 99 100 |
# File 'lib/punchblock/component/input.rb', line 98 def recognizer read_attr :recognizer end |
#recognizer=(recognizer) ⇒ Object
105 106 107 |
# File 'lib/punchblock/component/input.rb', line 105 def recognizer=(recognizer) write_attr :recognizer, recognizer end |
#sensitivity ⇒ Integer
Returns timeout to wait for user input.
126 127 128 |
# File 'lib/punchblock/component/input.rb', line 126 def sensitivity read_attr :sensitivity, :to_f end |
#sensitivity=(other) ⇒ Object
133 134 135 |
# File 'lib/punchblock/component/input.rb', line 133 def sensitivity=(other) write_attr :sensitivity, other end |
#term_timeout ⇒ Integer
Returns timeout to wait for user input.
168 169 170 |
# File 'lib/punchblock/component/input.rb', line 168 def term_timeout read_attr :'term-timeout', :to_i end |
#term_timeout=(other) ⇒ Object
175 176 177 |
# File 'lib/punchblock/component/input.rb', line 175 def term_timeout=(other) write_attr :'term-timeout', other end |
#terminator ⇒ String
Returns terminator by which to signal the end of input.
112 113 114 |
# File 'lib/punchblock/component/input.rb', line 112 def terminator read_attr :terminator end |
#terminator=(terminator) ⇒ Object
119 120 121 |
# File 'lib/punchblock/component/input.rb', line 119 def terminator=(terminator) write_attr :terminator, terminator end |