Class: SmsSender::Message
- Inherits:
-
Object
- Object
- SmsSender::Message
- Defined in:
- lib/message.rb
Instance Attribute Summary collapse
-
#telephone ⇒ Object
Returns the value of attribute telephone.
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(telephone, text) ⇒ Message
constructor
A new instance of Message.
- #to_s ⇒ Object
Constructor Details
#initialize(telephone, text) ⇒ Message
Returns a new instance of Message.
7 8 9 10 |
# File 'lib/message.rb', line 7 def initialize telephone, text @text = text @telephone = normalized_telephone telephone end |
Instance Attribute Details
#telephone ⇒ Object
Returns the value of attribute telephone.
5 6 7 |
# File 'lib/message.rb', line 5 def telephone @telephone end |
#text ⇒ Object
Returns the value of attribute text.
5 6 7 |
# File 'lib/message.rb', line 5 def text @text end |
Instance Method Details
#==(other) ⇒ Object
12 13 14 |
# File 'lib/message.rb', line 12 def == other ((other.text || "") == self.text) && ((other.telephone || "") == self.telephone) end |
#to_s ⇒ Object
16 17 18 |
# File 'lib/message.rb', line 16 def to_s "#{@telephone} - #{@text}" end |