Class: PaperPlane::FlightRoutes::Sms

Inherits:
Base
  • Object
show all
Defined in:
lib/paper_plane/flight_routes/sms.rb

Instance Attribute Summary

Attributes inherited from Base

#flight_routes, #mid, #params

Instance Method Summary collapse

Methods inherited from Base

#context, flight_routes, #fly, fly_action, #fly_now!, #flying_route?, inherited, #initialize, method_missing, register_flight_route, respond_to_missing?, skip, #skip, template_formats

Constructor Details

This class inherits a constructor from PaperPlane::Base

Instance Method Details

#do_flyObject



8
9
10
11
12
# File 'lib/paper_plane/flight_routes/sms.rb', line 8

def do_fly
  return if intercept?

  @_engine.create(message_payload)
end

#intercept?Boolean

Returns:

  • (Boolean)


22
# File 'lib/paper_plane/flight_routes/sms.rb', line 22

def intercept?; end

#message_payloadObject



14
15
16
17
18
19
20
# File 'lib/paper_plane/flight_routes/sms.rb', line 14

def message_payload
  {
    from: ENV['TWILIO_NUMBER'],
    to: recipient.full_mobile_number,
    body: template
  }
end