Class: Signupto::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/signupto/message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#bodyObject (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

#fromObject (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

#toObject (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