Class: Sisal::Message
- Inherits:
-
Object
- Object
- Sisal::Message
- Defined in:
- lib/sisal/message.rb
Constant Summary collapse
- InvalidPhoneNumber =
Class.new(StandardError)
- PHONE_REGEX =
/^\d+$/- PHONE_LENGTH =
[4, 15]
Instance Attribute Summary collapse
-
#text ⇒ Object
Returns the value of attribute text.
-
#to ⇒ Object
Returns the value of attribute to.
Instance Method Summary collapse
-
#initialize(to, text) ⇒ Message
constructor
A new instance of Message.
- #valid? ⇒ Boolean
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
#text ⇒ Object
Returns the value of attribute text.
8 9 10 |
# File 'lib/sisal/message.rb', line 8 def text @text end |
#to ⇒ Object
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
14 15 16 |
# File 'lib/sisal/message.rb', line 14 def valid? validate_number end |