Class: SmsSender::Message

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#telephoneObject

Returns the value of attribute telephone.



5
6
7
# File 'lib/message.rb', line 5

def telephone
  @telephone
end

#textObject

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_sObject



16
17
18
# File 'lib/message.rb', line 16

def to_s
  "#{@telephone} - #{@text}"
end