Class: FSR::App::Read
- Inherits:
-
Application
- Object
- Application
- FSR::App::Read
- Defined in:
- lib/fsr/app/read.rb
Constant Summary collapse
- SENDMSG_METHOD =
%q| def read(*args, &block) me = super(*args) @read_var = "variable_#{me.chan_var}" sendmsg me @queue.unshift Proc.new { update_session } @queue.unshift(block_given? ? block : lambda {}) end |
Instance Attribute Summary collapse
-
#chan_var ⇒ Object
readonly
Returns the value of attribute chan_var.
Instance Method Summary collapse
- #arguments ⇒ Object
-
#initialize(sound_file, min = 0, max = 10, chan_var = "fsr_read_dtmf", timeout = 10000, terminators = ["#"]) ⇒ Read
constructor
A new instance of Read.
- #sendmsg ⇒ Object
Methods inherited from Application
Constructor Details
#initialize(sound_file, min = 0, max = 10, chan_var = "fsr_read_dtmf", timeout = 10000, terminators = ["#"]) ⇒ Read
Returns a new instance of Read.
7 8 9 |
# File 'lib/fsr/app/read.rb', line 7 def initialize(sound_file, min = 0, max = 10, chan_var = "fsr_read_dtmf", timeout = 10000, terminators = ["#"]) @sound_file, @min, @max, @chan_var, @timeout, @terminators = sound_file, min, max, chan_var, timeout, terminators end |
Instance Attribute Details
#chan_var ⇒ Object (readonly)
Returns the value of attribute chan_var.
6 7 8 |
# File 'lib/fsr/app/read.rb', line 6 def chan_var @chan_var end |
Instance Method Details
#arguments ⇒ Object
11 12 13 |
# File 'lib/fsr/app/read.rb', line 11 def arguments [@min, @max, @sound_file, @chan_var, @timeout, @terminators.join(",")] end |
#sendmsg ⇒ Object
15 16 17 |
# File 'lib/fsr/app/read.rb', line 15 def sendmsg "call-command: execute\nexecute-app-name: %s\nexecute-app-arg: %s\nevent-lock:true\n\n" % [app_name, arguments.join(" ")] end |