Module: SmsOnRails::ModelSupport::PhoneCarrier::InstanceMethods
- Defined in:
- lib/sms_on_rails/model_support/phone_carrier.rb
Instance Method Summary collapse
-
#sms_email_address(phone, options = {}) ⇒ Object
Returns the email address for sms.
-
#to_s ⇒ Object
Return the carriers name when stringified.
Instance Method Details
#sms_email_address(phone, options = {}) ⇒ Object
Returns the email address for sms
-
phone
- phone number digits or an SmsOnRails::PhoneNumber -
options
- empty space now
att_carrier.sms_email_address('12065551111') => '[email protected]'
64 65 66 67 68 69 70 |
# File 'lib/sms_on_rails/model_support/phone_carrier.rb', line 64 def sms_email_address(phone, ={}) email = (phone.is_a?(ActiveRecord::Base) ? phone.digits : phone).dup email.gsub!(/^1/, '') email << '@' email << self.email_domain email end |
#to_s ⇒ Object
Return the carriers name when stringified
73 |
# File 'lib/sms_on_rails/model_support/phone_carrier.rb', line 73 def to_s; name; end |