Class: TwilioTestToolkit::CallInProgress
- Defined in:
- lib/twilio-test-toolkit/call_in_progress.rb
Overview
Models a call
Instance Attribute Summary collapse
-
#called ⇒ Object
readonly
Returns the value of attribute called.
-
#direction ⇒ Object
readonly
Returns the value of attribute direction.
-
#from_number ⇒ Object
readonly
Returns the value of attribute from_number.
-
#http_method ⇒ Object
readonly
Returns the value of attribute http_method.
-
#initial_path ⇒ Object
readonly
Returns the value of attribute initial_path.
-
#is_machine ⇒ Object
readonly
Returns the value of attribute is_machine.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#sid ⇒ Object
readonly
Returns the value of attribute sid.
-
#to_number ⇒ Object
readonly
Returns the value of attribute to_number.
Instance Method Summary collapse
-
#initialize(initial_path, from_number, to_number, options = {}) ⇒ CallInProgress
constructor
Initiate a call.
Methods inherited from CallScope
#current_path, #follow_redirect, #follow_redirect!, #gather?, #gather_action, #gather_finish_on_key, #gather_method, has_element, #has_redirect_to?, #method_missing, #press, #respond_to_missing?, #response_xml, #root_call
Constructor Details
#initialize(initial_path, from_number, to_number, options = {}) ⇒ CallInProgress
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/twilio-test-toolkit/call_in_progress.rb', line 15 def initialize(initial_path, from_number, to_number, = {}) = { :method => :post, :direction => 'inbound', :is_machine => false } @options = .merge() # Save our variables for later @initial_path = initial_path @from_number = from_number @to_number = to_number @is_machine = @options[:is_machine] @called = @options[:called] @direction = @options[:direction] @http_method = @options[:method] # Generate an initial call SID if we don't have one if ([:call_sid].nil?) @sid = UUIDTools::UUID.random_create.to_s else @sid = [:call_sid] end # We are the root call self.root_call = self # Create the request request_for_twiml!(@initial_path, @options) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class TwilioTestToolkit::CallScope
Instance Attribute Details
#called ⇒ Object (readonly)
Returns the value of attribute called.
9 10 11 |
# File 'lib/twilio-test-toolkit/call_in_progress.rb', line 9 def called @called end |
#direction ⇒ Object (readonly)
Returns the value of attribute direction.
9 10 11 |
# File 'lib/twilio-test-toolkit/call_in_progress.rb', line 9 def direction @direction end |
#from_number ⇒ Object (readonly)
Returns the value of attribute from_number.
8 9 10 |
# File 'lib/twilio-test-toolkit/call_in_progress.rb', line 8 def from_number @from_number end |
#http_method ⇒ Object (readonly)
Returns the value of attribute http_method.
7 8 9 |
# File 'lib/twilio-test-toolkit/call_in_progress.rb', line 7 def http_method @http_method end |
#initial_path ⇒ Object (readonly)
Returns the value of attribute initial_path.
7 8 9 |
# File 'lib/twilio-test-toolkit/call_in_progress.rb', line 7 def initial_path @initial_path end |
#is_machine ⇒ Object (readonly)
Returns the value of attribute is_machine.
9 10 11 |
# File 'lib/twilio-test-toolkit/call_in_progress.rb', line 9 def is_machine @is_machine end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/twilio-test-toolkit/call_in_progress.rb', line 6 def @options end |
#sid ⇒ Object (readonly)
Returns the value of attribute sid.
7 8 9 |
# File 'lib/twilio-test-toolkit/call_in_progress.rb', line 7 def sid @sid end |
#to_number ⇒ Object (readonly)
Returns the value of attribute to_number.
8 9 10 |
# File 'lib/twilio-test-toolkit/call_in_progress.rb', line 8 def to_number @to_number end |