Class: CellForce::MobileDevice
- Inherits:
-
Object
- Object
- CellForce::MobileDevice
- Includes:
- DefaultShortCode
- Defined in:
- lib/cell_force/mobile_device.rb
Instance Attribute Summary collapse
-
#phone ⇒ Object
readonly
Returns the value of attribute phone.
-
#short_code ⇒ Object
readonly
Returns the value of attribute short_code.
Instance Method Summary collapse
-
#initialize(phone, short_code = nil) ⇒ MobileDevice
constructor
A new instance of MobileDevice.
- #send_mt(message) ⇒ Object
- #simulate_mo(keyword, campaign_options = {}) ⇒ Object
Methods included from DefaultShortCode
Constructor Details
#initialize(phone, short_code = nil) ⇒ MobileDevice
Returns a new instance of MobileDevice.
9 10 11 |
# File 'lib/cell_force/mobile_device.rb', line 9 def initialize(phone, short_code=nil) @phone, @short_code = phone, short_code end |
Instance Attribute Details
#phone ⇒ Object (readonly)
Returns the value of attribute phone.
8 9 10 |
# File 'lib/cell_force/mobile_device.rb', line 8 def phone @phone end |
#short_code ⇒ Object (readonly)
Returns the value of attribute short_code.
8 9 10 |
# File 'lib/cell_force/mobile_device.rb', line 8 def short_code @short_code end |
Instance Method Details
#send_mt(message) ⇒ Object
13 14 15 |
# File 'lib/cell_force/mobile_device.rb', line 13 def send_mt() Api.post(Api::SEND_SMS_RESOURCE, sms_validation: SmsValidation::Sms.new(phone, ), shortcode_id: short_code_id).data["mt_id"] end |
#simulate_mo(keyword, campaign_options = {}) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/cell_force/mobile_device.rb', line 17 def simulate_mo(keyword, ={}) tcpa_opt_in_campaign = TcpaOptInCampaign.new(keyword) if tcpa_opt_in_campaign.campaign_ids.empty? tcpa_opt_in_campaign.create_campaign() end Api.post("sms/mo", cellnumber: phone, message: keyword, shortcode_id: short_code_id, carrier_id: carrier_id, trigger: "DOUBLEOPTIN") end |