Class: Voltron::Notification::SmsNotification
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Voltron::Notification::SmsNotification
- Defined in:
- app/models/voltron/notification/sms_notification.rb
Defined Under Namespace
Classes: Attachment
Instance Attribute Summary collapse
-
#created ⇒ Object
Returns the value of attribute created.
Instance Method Summary collapse
- #attach(*urls) ⇒ Object
-
#deliver_later(options = {}) ⇒ Object
Establish that the job should be enqueued, and set the options.
-
#deliver_now ⇒ Object
Establish that we will perform the job immediately.
- #request ⇒ Object
- #response ⇒ Object
- #valid_phone? ⇒ Boolean
Instance Attribute Details
#created ⇒ Object
Returns the value of attribute created.
29 30 31 |
# File 'app/models/voltron/notification/sms_notification.rb', line 29 def created @created end |
Instance Method Details
#attach(*urls) ⇒ Object
51 52 53 54 55 56 57 58 59 |
# File 'app/models/voltron/notification/sms_notification.rb', line 51 def attach(*urls) urls.flatten.each do |url| if url.starts_with? 'http' .build attachment: url else .build attachment: Voltron.config.base_url + ActionController::Base.helpers.asset_url(url) end end end |
#deliver_later(options = {}) ⇒ Object
Establish that the job should be enqueued, and set the options
46 47 48 49 |
# File 'app/models/voltron/notification/sms_notification.rb', line 46 def deliver_later(={}) @job_options = @job_method = :perform_later end |
#deliver_now ⇒ Object
Establish that we will perform the job immediately. Will cause send_now
to be called instead when saved
40 41 42 43 |
# File 'app/models/voltron/notification/sms_notification.rb', line 40 def deliver_now @job_options = {} @job_method = :perform_now end |
#request ⇒ Object
31 32 33 |
# File 'app/models/voltron/notification/sms_notification.rb', line 31 def request Voltron::Notification.format_output_of(request_json) end |
#response ⇒ Object
35 36 37 |
# File 'app/models/voltron/notification/sms_notification.rb', line 35 def response Voltron::Notification.format_output_of(response_json) end |