Class: Trails::Twilio::Incoming

Inherits:
Object
  • Object
show all
Defined in:
lib/trails/twilio/incoming.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request, opts = {}) ⇒ Incoming

Returns a new instance of Incoming.



5
6
7
8
# File 'lib/trails/twilio/incoming.rb', line 5

def initialize( request, opts = {} )
  @request = request
  @account = Trails::Twilio::Account.from_request( request )
end

Instance Attribute Details

#accountObject (readonly)

Returns the value of attribute account.



4
5
6
# File 'lib/trails/twilio/incoming.rb', line 4

def 
  @account
end

Instance Method Details

#complete?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/trails/twilio/incoming.rb', line 18

def complete?
  'completed' == self.call_status.downcase
end

#is_sms?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/trails/twilio/incoming.rb', line 14

def is_sms?
  !sms_message_sid.blank?
end

#twilio_dataObject



10
11
12
# File 'lib/trails/twilio/incoming.rb', line 10

def twilio_data
  request.params.slice( *INCOMING_VARS ).dup
end