Class: Sisal::Message

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

Constant Summary collapse

InvalidPhoneNumber =
Class.new(StandardError)
PHONE_REGEX =
/^\d+$/
PHONE_LENGTH =
[4, 15]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(to, text) ⇒ Message

Returns a new instance of Message.



10
11
12
# File 'lib/sisal/message.rb', line 10

def initialize(to, text)
  @to, @text = to, text
end

Instance Attribute Details

#textObject

Returns the value of attribute text.



8
9
10
# File 'lib/sisal/message.rb', line 8

def text
  @text
end

#toObject

Returns the value of attribute to.



8
9
10
# File 'lib/sisal/message.rb', line 8

def to
  @to
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/sisal/message.rb', line 14

def valid?
  validate_number
end