Class: Barge::Response
- Inherits:
-
Hashie::Mash
- Object
- Hashie::Mash
- Barge::Response
- Extended by:
- Forwardable
- Defined in:
- lib/barge/response.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(faraday_response) ⇒ Response
constructor
A new instance of Response.
- #last_page ⇒ Object
- #next_page ⇒ Object
- #paginated? ⇒ Boolean
- #prev_page ⇒ Object
Constructor Details
#initialize(faraday_response) ⇒ Response
Returns a new instance of Response.
10 11 12 13 |
# File 'lib/barge/response.rb', line 10 def initialize(faraday_response) @response = faraday_response super(faraday_response.body) end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
7 8 9 |
# File 'lib/barge/response.rb', line 7 def response @response end |
Instance Method Details
#last_page ⇒ Object
27 28 29 |
# File 'lib/barge/response.rb', line 27 def last_page extract_page(:last) end |
#next_page ⇒ Object
23 24 25 |
# File 'lib/barge/response.rb', line 23 def next_page extract_page(:next) end |
#paginated? ⇒ Boolean
15 16 17 |
# File 'lib/barge/response.rb', line 15 def paginated? !(links && links.pages).nil? end |
#prev_page ⇒ Object
19 20 21 |
# File 'lib/barge/response.rb', line 19 def prev_page extract_page(:prev) end |