Class: Trails::Twilio::Incoming
- Inherits:
-
Object
- Object
- Trails::Twilio::Incoming
- Defined in:
- lib/trails/twilio/incoming.rb
Instance Attribute Summary collapse
-
#account ⇒ Object
readonly
Returns the value of attribute account.
Instance Method Summary collapse
- #complete? ⇒ Boolean
-
#initialize(request, opts = {}) ⇒ Incoming
constructor
A new instance of Incoming.
- #is_sms? ⇒ Boolean
- #twilio_data ⇒ Object
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
#account ⇒ Object (readonly)
Returns the value of attribute account.
4 5 6 |
# File 'lib/trails/twilio/incoming.rb', line 4 def account @account end |
Instance Method Details
#complete? ⇒ Boolean
18 19 20 |
# File 'lib/trails/twilio/incoming.rb', line 18 def complete? 'completed' == self.call_status.downcase end |
#is_sms? ⇒ Boolean
14 15 16 |
# File 'lib/trails/twilio/incoming.rb', line 14 def is_sms? !.blank? end |
#twilio_data ⇒ Object
10 11 12 |
# File 'lib/trails/twilio/incoming.rb', line 10 def twilio_data request.params.slice( *INCOMING_VARS ).dup end |