Class: Urbanairship::Devices::SmsNotification
- Inherits:
-
Object
- Object
- Urbanairship::Devices::SmsNotification
- Defined in:
- lib/urbanairship/devices/sms_notification.rb
Constant Summary
Constants included from Common
Instance Attribute Summary collapse
-
#expiry ⇒ Object
Returns the value of attribute expiry.
-
#generic_alert ⇒ Object
Returns the value of attribute generic_alert.
-
#shorten_links ⇒ Object
Returns the value of attribute shorten_links.
-
#sms_alert ⇒ Object
Returns the value of attribute sms_alert.
-
#template_id ⇒ Object
Returns the value of attribute template_id.
Instance Method Summary collapse
-
#initialize(client: required('client')) ⇒ SmsNotification
constructor
A new instance of SmsNotification.
- #sms_inline_template ⇒ Object
- #sms_notification_override ⇒ Object
Methods included from Loggable
create_logger, logger, #logger
Methods included from Common
#apid_path, #channel_path, #compact_helper, #create_and_send_path, #custom_events_path, #device_token_path, #experiments_path, #lists_path, #named_users_path, #open_channel_path, #pipelines_path, #push_path, #reports_path, #required, #schedules_path, #segments_path, #tag_lists_path, #try_helper
Constructor Details
#initialize(client: required('client')) ⇒ SmsNotification
Returns a new instance of SmsNotification.
16 17 18 |
# File 'lib/urbanairship/devices/sms_notification.rb', line 16 def initialize(client: required('client')) @client = client end |
Instance Attribute Details
#expiry ⇒ Object
Returns the value of attribute expiry.
10 11 12 |
# File 'lib/urbanairship/devices/sms_notification.rb', line 10 def expiry @expiry end |
#generic_alert ⇒ Object
Returns the value of attribute generic_alert.
10 11 12 |
# File 'lib/urbanairship/devices/sms_notification.rb', line 10 def generic_alert @generic_alert end |
#shorten_links ⇒ Object
Returns the value of attribute shorten_links.
10 11 12 |
# File 'lib/urbanairship/devices/sms_notification.rb', line 10 def shorten_links @shorten_links end |
#sms_alert ⇒ Object
Returns the value of attribute sms_alert.
10 11 12 |
# File 'lib/urbanairship/devices/sms_notification.rb', line 10 def sms_alert @sms_alert end |
#template_id ⇒ Object
Returns the value of attribute template_id.
10 11 12 |
# File 'lib/urbanairship/devices/sms_notification.rb', line 10 def template_id @template_id end |
Instance Method Details
#sms_inline_template ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/urbanairship/devices/sms_notification.rb', line 31 def sms_inline_template inline_template = { "sms": { "template": {} } } if @template_id inline_template[:sms][:template][:template_id] = @template_id end if @sms_alert inline_fields= { "fields": {"alert": @sms_alert} } inline_template[:sms][:template] = inline_fields end inline_template end |
#sms_notification_override ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/urbanairship/devices/sms_notification.rb', line 20 def sms_notification_override { "alert": generic_alert, "sms": { "alert": sms_alert, "expiry": expiry, "shorten_links": shorten_links } } end |