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 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
35 36 37 38 39 |
# File 'lib/punchblock/component/input.rb', line 35 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.
184 185 186 |
# File 'lib/punchblock/component/input.rb', line 184 def complete_timeout read_attr :'complete-timeout', :to_i end |
#complete_timeout=(other) ⇒ Object
191 192 193 |
# File 'lib/punchblock/component/input.rb', line 191 def complete_timeout=(other) write_attr :'complete-timeout', other end |
#grammar ⇒ Choices
Returns the choices available.
212 213 214 215 |
# File 'lib/punchblock/component/input.rb', line 212 def grammar node = find_first 'ns:grammar', :ns => self.class.registered_ns Grammar.new node if node end |
#grammar=(other) ⇒ Object
222 223 224 225 226 227 |
# File 'lib/punchblock/component/input.rb', line 222 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.
198 199 200 |
# File 'lib/punchblock/component/input.rb', line 198 def incomplete_timeout read_attr :'incomplete-timeout', :to_i end |
#incomplete_timeout=(other) ⇒ Object
205 206 207 |
# File 'lib/punchblock/component/input.rb', line 205 def incomplete_timeout=(other) write_attr :'incomplete-timeout', other end |
#initial_timeout ⇒ Integer
Returns timeout to wait for user input.
142 143 144 |
# File 'lib/punchblock/component/input.rb', line 142 def initial_timeout read_attr :'initial-timeout', :to_i end |
#initial_timeout=(other) ⇒ Object
149 150 151 |
# File 'lib/punchblock/component/input.rb', line 149 def initial_timeout=(other) write_attr :'initial-timeout', other end |
#inspect_attributes ⇒ Object
:nodoc:
229 230 231 |
# File 'lib/punchblock/component/input.rb', line 229 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.
156 157 158 |
# File 'lib/punchblock/component/input.rb', line 156 def inter_digit_timeout read_attr :'inter-digit-timeout', :to_i end |
#inter_digit_timeout=(other) ⇒ Object
163 164 165 |
# File 'lib/punchblock/component/input.rb', line 163 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.
44 45 46 |
# File 'lib/punchblock/component/input.rb', line 44 def max_digits read_attr :'max-digits', :to_i end |
#max_digits=(other) ⇒ Object
51 52 53 |
# File 'lib/punchblock/component/input.rb', line 51 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.
58 59 60 |
# File 'lib/punchblock/component/input.rb', line 58 def max_silence read_attr :'max-silence', :to_i end |
#max_silence=(other) ⇒ Object
65 66 67 |
# File 'lib/punchblock/component/input.rb', line 65 def max_silence=(other) write_attr :'max-silence', other end |
#min_confidence ⇒ Float
Returns Confidence with which to consider a response acceptable.
72 73 74 |
# File 'lib/punchblock/component/input.rb', line 72 def min_confidence read_attr 'min-confidence', :to_f end |
#min_confidence=(min_confidence) ⇒ Object
79 80 81 |
# File 'lib/punchblock/component/input.rb', line 79 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.
86 87 88 |
# File 'lib/punchblock/component/input.rb', line 86 def mode read_attr :mode, :to_sym end |
#mode=(mode) ⇒ Object
93 94 95 |
# File 'lib/punchblock/component/input.rb', line 93 def mode=(mode) write_attr :mode, mode end |
#recognizer ⇒ String
Returns recognizer to use for speech recognition.
100 101 102 |
# File 'lib/punchblock/component/input.rb', line 100 def recognizer read_attr :recognizer end |
#recognizer=(recognizer) ⇒ Object
107 108 109 |
# File 'lib/punchblock/component/input.rb', line 107 def recognizer=(recognizer) write_attr :recognizer, recognizer end |
#sensitivity ⇒ Integer
Returns timeout to wait for user input.
128 129 130 |
# File 'lib/punchblock/component/input.rb', line 128 def sensitivity read_attr :sensitivity, :to_f end |
#sensitivity=(other) ⇒ Object
135 136 137 |
# File 'lib/punchblock/component/input.rb', line 135 def sensitivity=(other) write_attr :sensitivity, other end |
#term_timeout ⇒ Integer
Returns timeout to wait for user input.
170 171 172 |
# File 'lib/punchblock/component/input.rb', line 170 def term_timeout read_attr :'term-timeout', :to_i end |
#term_timeout=(other) ⇒ Object
177 178 179 |
# File 'lib/punchblock/component/input.rb', line 177 def term_timeout=(other) write_attr :'term-timeout', other end |
#terminator ⇒ String
Returns terminator by which to signal the end of input.
114 115 116 |
# File 'lib/punchblock/component/input.rb', line 114 def terminator read_attr :terminator end |
#terminator=(terminator) ⇒ Object
121 122 123 |
# File 'lib/punchblock/component/input.rb', line 121 def terminator=(terminator) write_attr :terminator, terminator end |