Class: Splat::Response

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initializeResponse

Returns a new instance of Response.



11
12
13
# File 'lib/splat/response.rb', line 11

def initialize
  @phone_numbers = {}
end

Instance Attribute Details

#messageObject

Returns the value of attribute message.



9
10
11
# File 'lib/splat/response.rb', line 9

def message
  @message
end

#phone_numbersObject

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, message)
  @phone_numbers[number] = message 
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_numbersObject



23
24
25
# File 'lib/splat/response.rb', line 23

def invalid_phone_numbers
  @phone_numbers.keys
end