Class: ServiceShooter::Response

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Response

Returns a new instance of Response.



22
23
24
25
26
27
# File 'lib/service_shooter.rb', line 22

def initialize(response)
  response = response.with_indifferent_access
  code = (response[:code] || response[:status]).to_i || 0
  self.code = code
  self.message = response[:message] || ResponseMapper.status(code)
end

Instance Attribute Details

#codeObject

Returns the value of attribute code.



21
22
23
# File 'lib/service_shooter.rb', line 21

def code
  @code
end

#messageObject

Returns the value of attribute message.



21
22
23
# File 'lib/service_shooter.rb', line 21

def message
  @message
end