Module: SmsOnRails::ModelSupport::Outbound::InstanceMethods
- Defined in:
- lib/sms_on_rails/model_support/outbound.rb
Overview
ClassMethods
Instance Method Summary collapse
- #actual_message ⇒ Object
-
#actual_message=(msg) ⇒ Object
only save the actual message if it differs from the draft message.
- #assign_existing_phone ⇒ Object
- #assign_phone_number(phone) ⇒ Object
-
#draft_message ⇒ Object
The actual (not substituted draft message Substituted message can be obtained with
substituted_draft_message
. - #phone_number_digits ⇒ Object
- #phone_number_digits=(digits) ⇒ Object
-
#sender_name ⇒ Object
Todo.
Instance Method Details
#actual_message ⇒ Object
101 102 103 |
# File 'lib/sms_on_rails/model_support/outbound.rb', line 101 def read_attribute(:actual_message) || end |
#actual_message=(msg) ⇒ Object
only save the actual message if it differs from the draft message
106 107 108 |
# File 'lib/sms_on_rails/model_support/outbound.rb', line 106 def (msg) write_attribute(:actual_message, msg) unless == end |
#assign_existing_phone ⇒ Object
95 |
# File 'lib/sms_on_rails/model_support/outbound.rb', line 95 def assign_existing_phone; assign_phone_number(self.phone_number); end |
#assign_phone_number(phone) ⇒ Object
91 92 93 |
# File 'lib/sms_on_rails/model_support/outbound.rb', line 91 def assign_phone_number(phone) self.phone_number = SmsOnRails::PhoneNumber.find_and_create_by_number(phone) end |
#draft_message ⇒ Object
The actual (not substituted draft message Substituted message can be obtained with substituted_draft_message
99 |
# File 'lib/sms_on_rails/model_support/outbound.rb', line 99 def ; draft. if draft; end |
#phone_number_digits ⇒ Object
80 81 82 |
# File 'lib/sms_on_rails/model_support/outbound.rb', line 80 def phone_number_digits self['phone_number_digits']||(phone_number ? phone_number.number : nil) end |
#phone_number_digits=(digits) ⇒ Object
84 85 86 87 88 89 |
# File 'lib/sms_on_rails/model_support/outbound.rb', line 84 def phone_number_digits=(digits) self.phone_number ||= SmsOnRails::PhoneNumber.new self.phone_number.number = digits assign_existing_phone self.phone_number.number end |
#sender_name ⇒ Object
Todo
111 |
# File 'lib/sms_on_rails/model_support/outbound.rb', line 111 def sender_name; ''; end |