Class: BitBucket::PageLinks
- Inherits:
-
Object
- Object
- BitBucket::PageLinks
- Includes:
- Constants
- Defined in:
- lib/bitbucket_rest_api/page_links.rb
Overview
Determines the links in the current response to be used to find the links to other pages of request responses.
Constant Summary collapse
- FIRST_PAGE_NUMBER =
:nodoc:
1
Constants included from Constants
Constants::ACCEPT, Constants::ACCEPT_CHARSET, Constants::CACHE_CONTROL, Constants::CONTENT_LENGTH, Constants::CONTENT_TYPE, Constants::DATE, Constants::ETAG, Constants::LOCATION, Constants::META_FIRST, Constants::META_LAST, Constants::META_NEXT, Constants::META_PREV, Constants::META_REL, Constants::PARAM_PAGE, Constants::PARAM_START_PAGE, Constants::QUERY_STR_SEP, Constants::RATELIMIT_LIMIT, Constants::RATELIMIT_REMAINING, Constants::SERVER, Constants::USER_AGENT
Instance Attribute Summary collapse
-
#first ⇒ Object
Hold the extracted values for URI from the response body for the next and previous page.
-
#next ⇒ Object
Hold the extracted values for URI from the response body for the next and previous page.
-
#prev ⇒ Object
Hold the extracted values for URI from the response body for the next and previous page.
-
#response_dup ⇒ Object
Hold the extracted values for URI from the response body for the next and previous page.
Instance Method Summary collapse
-
#initialize(response) ⇒ PageLinks
constructor
Parses links from executed request.
Constructor Details
#initialize(response) ⇒ PageLinks
Parses links from executed request
15 16 17 18 19 20 21 22 |
# File 'lib/bitbucket_rest_api/page_links.rb', line 15 def initialize(response) self.response_dup = response if response.body.is_a?(Hash) and !response.body[PARAM_PAGE].nil? self.first = path_for_page(FIRST_PAGE_NUMBER) self.next = response.body[META_NEXT] unless response.body self.prev = response.body[META_PREV] end end |
Instance Attribute Details
#first ⇒ Object
Hold the extracted values for URI from the response body for the next and previous page.
11 12 13 |
# File 'lib/bitbucket_rest_api/page_links.rb', line 11 def first @first end |
#next ⇒ Object
Hold the extracted values for URI from the response body for the next and previous page.
11 12 13 |
# File 'lib/bitbucket_rest_api/page_links.rb', line 11 def next @next end |
#prev ⇒ Object
Hold the extracted values for URI from the response body for the next and previous page.
11 12 13 |
# File 'lib/bitbucket_rest_api/page_links.rb', line 11 def prev @prev end |
#response_dup ⇒ Object
Hold the extracted values for URI from the response body for the next and previous page.
11 12 13 |
# File 'lib/bitbucket_rest_api/page_links.rb', line 11 def response_dup @response_dup end |