Class: Rapa::Responses::BaseResponse
- Inherits:
-
Object
- Object
- Rapa::Responses::BaseResponse
show all
- Includes:
- Enumerable
- Defined in:
- lib/rapa/responses/base_response.rb
Instance Method Summary
collapse
Constructor Details
#initialize(faraday_response) ⇒ BaseResponse
Returns a new instance of BaseResponse.
7
8
9
|
# File 'lib/rapa/responses/base_response.rb', line 7
def initialize(faraday_response)
@faraday_response = faraday_response
end
|
Instance Method Details
#body ⇒ String
12
13
14
|
# File 'lib/rapa/responses/base_response.rb', line 12
def body
faraday_response.body
end
|
#each(&block) ⇒ Object
Note:
Implementation for Enumerable
17
18
19
|
# File 'lib/rapa/responses/base_response.rb', line 17
def each(&block)
resources.each(&block)
end
|
22
23
24
|
# File 'lib/rapa/responses/base_response.rb', line 22
def
faraday_response.
end
|
27
28
29
30
31
|
# File 'lib/rapa/responses/base_response.rb', line 27
def resources
sources.map do |source|
resource_class.new(source)
end
end
|
#status ⇒ Integer
34
35
36
|
# File 'lib/rapa/responses/base_response.rb', line 34
def status
faraday_response.status
end
|