Class: SMSApi::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/client_smsapi/response.rb,
lib/client_smsapi/response/error.rb,
lib/client_smsapi/response/regular.rb

Direct Known Subclasses

Error, Regular

Defined Under Namespace

Classes: Error, Regular

Constant Summary collapse

InvalidStatus =
Class.new(StandardError)
ALLOWED_STATUSES =
[:ok, :error]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status) ⇒ Response

Returns a new instance of Response.



12
13
14
15
# File 'lib/client_smsapi/response.rb', line 12

def initialize(status)
  fail InvalidStatus unless ALLOWED_STATUSES.include?(status)
  @status = status
end

Instance Attribute Details

#statusObject (readonly)

Returns the value of attribute status.



8
9
10
# File 'lib/client_smsapi/response.rb', line 8

def status
  @status
end