Class: Adhearsion::VoIP::DSL::Dialplan::EventCommand
- Defined in:
- lib/adhearsion/voip/dsl/dialplan/dispatcher.rb
Overview
Instantiated and returned in every dialplan command
Direct Known Subclasses
Instance Attribute Summary collapse
-
#app ⇒ Object
Returns the value of attribute app.
-
#args ⇒ Object
Returns the value of attribute args.
-
#on_keypress(&block) ⇒ Object
Returns the value of attribute on_keypress.
-
#response_block ⇒ Object
Returns the value of attribute response_block.
-
#returns ⇒ Object
Returns the value of attribute returns.
Instance Method Summary collapse
-
#initialize(app, *args, &block) ⇒ EventCommand
constructor
A new instance of EventCommand.
- #on_break(&block) ⇒ Object
Constructor Details
#initialize(app, *args, &block) ⇒ EventCommand
Returns a new instance of EventCommand.
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/adhearsion/voip/dsl/dialplan/dispatcher.rb', line 21 def initialize(app, *args, &block) @hash = args.pop if args.last.kind_of?(Hash) @app, @args = app, args if @hash @returns = @hash[:returns] || :raw @on_keypress = @hash[:on_keypress] end @response_block = block if block_given? end |
Instance Attribute Details
#app ⇒ Object
Returns the value of attribute app.
19 20 21 |
# File 'lib/adhearsion/voip/dsl/dialplan/dispatcher.rb', line 19 def app @app end |
#args ⇒ Object
Returns the value of attribute args.
19 20 21 |
# File 'lib/adhearsion/voip/dsl/dialplan/dispatcher.rb', line 19 def args @args end |
#on_keypress(&block) ⇒ Object
Returns the value of attribute on_keypress.
19 20 21 |
# File 'lib/adhearsion/voip/dsl/dialplan/dispatcher.rb', line 19 def on_keypress @on_keypress end |
#response_block ⇒ Object
Returns the value of attribute response_block.
19 20 21 |
# File 'lib/adhearsion/voip/dsl/dialplan/dispatcher.rb', line 19 def response_block @response_block end |
#returns ⇒ Object
Returns the value of attribute returns.
19 20 21 |
# File 'lib/adhearsion/voip/dsl/dialplan/dispatcher.rb', line 19 def returns @returns end |
Instance Method Details
#on_break(&block) ⇒ Object
37 38 39 |
# File 'lib/adhearsion/voip/dsl/dialplan/dispatcher.rb', line 37 def on_break(&block) block_given? ? @on_break = block : @on_break end |