Class: Splat::Response
- Inherits:
-
Object
- Object
- Splat::Response
- Defined in:
- lib/splat/response.rb
Constant Summary collapse
- INVALID_NUMBER_FORMAT =
"Invalid phone number format"
- SUCCESSFUL =
'Message sent successfully'
- FAIL =
"Fail to send message"
Instance Attribute Summary collapse
-
#message ⇒ Object
Returns the value of attribute message.
-
#phone_numbers ⇒ Object
Returns the value of attribute phone_numbers.
Instance Method Summary collapse
- #add(number, message) ⇒ Object
-
#initialize ⇒ Response
constructor
A new instance of Response.
- #invalid_phone_format(number) ⇒ Object
- #invalid_phone_numbers ⇒ Object
Constructor Details
#initialize ⇒ Response
Returns a new instance of Response.
11 12 13 |
# File 'lib/splat/response.rb', line 11 def initialize @phone_numbers = {} end |
Instance Attribute Details
#message ⇒ Object
Returns the value of attribute message.
9 10 11 |
# File 'lib/splat/response.rb', line 9 def @message end |
#phone_numbers ⇒ Object
Returns the value of attribute phone_numbers.
9 10 11 |
# File 'lib/splat/response.rb', line 9 def phone_numbers @phone_numbers end |
Instance Method Details
#add(number, message) ⇒ Object
19 20 21 |
# File 'lib/splat/response.rb', line 19 def add(number, ) @phone_numbers[number] = end |
#invalid_phone_format(number) ⇒ Object
15 16 17 |
# File 'lib/splat/response.rb', line 15 def invalid_phone_format(number) @phone_numbers[number] = INVALID_NUMBER_FORMAT end |
#invalid_phone_numbers ⇒ Object
23 24 25 |
# File 'lib/splat/response.rb', line 23 def invalid_phone_numbers @phone_numbers.keys end |