Class: Cage::Response
- Inherits:
-
Object
- Object
- Cage::Response
- Defined in:
- lib/cage/response.rb
Instance Attribute Summary collapse
-
#faraday_response ⇒ Object
readonly
Returns the value of attribute faraday_response.
Instance Method Summary collapse
- #body ⇒ Object
- #headers ⇒ Object
-
#initialize(faraday_response) ⇒ Response
constructor
A new instance of Response.
- #inspect ⇒ Object
- #status ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(faraday_response) ⇒ Response
Returns a new instance of Response.
5 6 7 |
# File 'lib/cage/response.rb', line 5 def initialize faraday_response @faraday_response = faraday_response end |
Instance Attribute Details
#faraday_response ⇒ Object (readonly)
Returns the value of attribute faraday_response.
3 4 5 |
# File 'lib/cage/response.rb', line 3 def faraday_response @faraday_response end |
Instance Method Details
#body ⇒ Object
9 10 11 |
# File 'lib/cage/response.rb', line 9 def body @faraday_response.body end |
#headers ⇒ Object
17 18 19 |
# File 'lib/cage/response.rb', line 17 def headers @faraday_response.headers end |
#inspect ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/cage/response.rb', line 25 def inspect <<-PRETTY Status: #{status} Headers: #{headers.map { |k, v| " #{k}: #{v}" }.join "\n"} Body: #{body} #<Cage::Response:(#{url})> PRETTY end |
#status ⇒ Object
13 14 15 |
# File 'lib/cage/response.rb', line 13 def status @faraday_response.status end |
#url ⇒ Object
21 22 23 |
# File 'lib/cage/response.rb', line 21 def url @faraday_response.env[:url].to_s end |