Class: ServiceShooter::Response
- Inherits:
-
Object
- Object
- ServiceShooter::Response
- Defined in:
- lib/service_shooter.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#message ⇒ Object
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(response) ⇒ Response
constructor
A new instance of Response.
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. = response[:message] || ResponseMapper.status(code) end |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
21 22 23 |
# File 'lib/service_shooter.rb', line 21 def code @code end |
#message ⇒ Object
Returns the value of attribute message.
21 22 23 |
# File 'lib/service_shooter.rb', line 21 def @message end |