Class: RubyDuga::Response

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(faraday_response) ⇒ Response

Returns a new instance of Response.



5
6
7
# File 'lib/ruby_duga/response.rb', line 5

def initialize(faraday_response)
  @original_response = faraday_response
end

Instance Attribute Details

#original_responseObject (readonly)

Returns the value of attribute original_response.



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

def original_response
  @original_response
end

Instance Method Details

#bodyObject



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

def body
  @body ||= original_response.body.deep_symbolize_keys
end

#headersObject



15
16
17
# File 'lib/ruby_duga/response.rb', line 15

def headers
  original_response.headers
end

#statusObject



19
20
21
# File 'lib/ruby_duga/response.rb', line 19

def status
  original_response.status
end