Class: PixivApi::Response::Pagination
- Inherits:
-
PixivApi::Response
- Object
- PixivApi::Response
- PixivApi::Response::Pagination
- Defined in:
- lib/pixiv_api/response/pagination.rb
Instance Attribute Summary collapse
-
#current ⇒ Object
readonly
Returns the value of attribute current.
-
#next ⇒ Object
readonly
Returns the value of attribute next.
-
#pages ⇒ Object
readonly
Returns the value of attribute pages.
-
#per_page ⇒ Object
readonly
Returns the value of attribute per_page.
-
#previous ⇒ Object
readonly
Returns the value of attribute previous.
-
#total ⇒ Object
readonly
Returns the value of attribute total.
Attributes inherited from PixivApi::Response
Class Method Summary collapse
Methods inherited from PixivApi::Response
#[], attr_reader, define_attribute_method, define_attributes_method, define_blob_method, define_time_method, #initialize
Constructor Details
This class inherits a constructor from PixivApi::Response
Instance Attribute Details
#current ⇒ Object (readonly)
Returns the value of attribute current.
21 22 23 |
# File 'lib/pixiv_api/response/pagination.rb', line 21 def current @current end |
#next ⇒ Object (readonly)
Returns the value of attribute next.
21 22 23 |
# File 'lib/pixiv_api/response/pagination.rb', line 21 def next @next end |
#pages ⇒ Object (readonly)
Returns the value of attribute pages.
21 22 23 |
# File 'lib/pixiv_api/response/pagination.rb', line 21 def pages @pages end |
#per_page ⇒ Object (readonly)
Returns the value of attribute per_page.
21 22 23 |
# File 'lib/pixiv_api/response/pagination.rb', line 21 def per_page @per_page end |
#previous ⇒ Object (readonly)
Returns the value of attribute previous.
21 22 23 |
# File 'lib/pixiv_api/response/pagination.rb', line 21 def previous @previous end |
#total ⇒ Object (readonly)
Returns the value of attribute total.
21 22 23 |
# File 'lib/pixiv_api/response/pagination.rb', line 21 def total @total end |
Class Method Details
.define_pagination_url(*attrs) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/pixiv_api/response/pagination.rb', line 8 def self.define_pagination_url(*attrs) attrs.each do |attr| define_method "#{attr}_url" do if self[attr] params = @request.params.merge('page' => self[attr]) url = @request.url url.query = URI.encode_www_form(params) url end end end end |
.from_response(response, *attributes) ⇒ Object
4 5 6 |
# File 'lib/pixiv_api/response/pagination.rb', line 4 def self.from_response(response, *attributes) new(response, *attributes) end |