Class: JsonClient::BaseResponses::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/json_client/base_responses/response.rb

Direct Known Subclasses

Create, Destroy, Index, Show, Update

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw_response) ⇒ Response

Returns a new instance of Response.



6
7
8
# File 'lib/json_client/base_responses/response.rb', line 6

def initialize(raw_response)
  @raw_response = raw_response
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object



10
11
12
# File 'lib/json_client/base_responses/response.rb', line 10

def method_missing(name, *args)
  raw_response.public_send(name, *args)
end

Instance Attribute Details

#raw_responseObject (readonly)

Returns the value of attribute raw_response.



4
5
6
# File 'lib/json_client/base_responses/response.rb', line 4

def raw_response
  @raw_response
end

Instance Method Details

#jsonObject



14
15
16
# File 'lib/json_client/base_responses/response.rb', line 14

def json
  parse_json
end