Class: Signupto::Message
- Inherits:
-
Object
- Object
- Signupto::Message
- Defined in:
- lib/signupto/message.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Make the elements of the message accesible.
-
#from ⇒ Object
readonly
Make the elements of the message accesible.
-
#to ⇒ Object
readonly
Make the elements of the message accesible.
Instance Method Summary collapse
-
#initialize(to, body, from = nil) ⇒ Message
constructor
Set the recipient (which must be in international format, with no leading +) and the from paramater, and the body.
Constructor Details
#initialize(to, body, from = nil) ⇒ Message
Set the recipient (which must be in international format, with no leading +) and the from paramater, and the body. The From paramater will take a string up to 12 characters long, then on the recipients phone it will appear as if it is from someone in there contacts rather than and unknown number.
13 14 15 16 |
# File 'lib/signupto/message.rb', line 13 def initialize(to, body, from = nil) # validate_number(to) @to, @body, @from = to, URI.encode(body), from end |
Instance Attribute Details
#body ⇒ Object (readonly)
Make the elements of the message accesible. This way you can do @message.from etc to makes debuging the code a lot simpler (I find at least)
7 8 9 |
# File 'lib/signupto/message.rb', line 7 def body @body end |
#from ⇒ Object (readonly)
Make the elements of the message accesible. This way you can do @message.from etc to makes debuging the code a lot simpler (I find at least)
7 8 9 |
# File 'lib/signupto/message.rb', line 7 def from @from end |
#to ⇒ Object (readonly)
Make the elements of the message accesible. This way you can do @message.from etc to makes debuging the code a lot simpler (I find at least)
7 8 9 |
# File 'lib/signupto/message.rb', line 7 def to @to end |