Class: Pixiv::OwnedIllustList Abstract
- Inherits:
-
IllustList
- Object
- Page
- IllustList
- Pixiv::OwnedIllustList
- Defined in:
- lib/pixiv/owned_illust_list.rb
Overview
This class is abstract.
Illust list owned by a member
Implements common methods for bookmark.php and member_illust.php.
Direct Known Subclasses
Defined Under Namespace
Modules: WithClient
Constant Summary collapse
- ILLUSTS_PER_PAGE =
include ::Pixiv::OwnedIllustList::WithClient
20
Instance Attribute Summary collapse
-
#last? ⇒ Boolean
readonly
Lazily returns last?.
-
#member_id ⇒ Integer
(also: #owner_id)
readonly
Lazily returns member_id.
-
#page ⇒ Integer
readonly
Lazily returns page.
Attributes inherited from IllustList
Class Method Summary collapse
-
.url(member_id, page = 1) ⇒ String
Returns the URL for given
member_id
andpage
.
Instance Method Summary collapse
Methods inherited from IllustList
#doc, #illust_hashes, #page_class
Methods included from PageCollection
#next_attrs, #page_class, #page_hashes, #prev_attrs, #size
Methods inherited from Page
#bind, #doc, #fetched?, #force, #initialize, lazy_new
Constructor Details
This class inherits a constructor from Pixiv::Page
Instance Attribute Details
#last? ⇒ Boolean (readonly)
Lazily returns last?
26 27 28 |
# File 'lib/pixiv/owned_illust_list.rb', line 26 lazy_attr_reader(:last?) { at!('ul.page-list .current').next_element.nil? } |
#member_id ⇒ Integer (readonly) Also known as: owner_id
Lazily returns member_id
30 31 32 |
# File 'lib/pixiv/owned_illust_list.rb', line 30 lazy_attr_reader(:member_id) { doc.body[/pixiv\.context\.userId = '(\d+)'/, 1].to_i } |
#page ⇒ Integer (readonly)
Lazily returns page
22 23 24 |
# File 'lib/pixiv/owned_illust_list.rb', line 22 lazy_attr_reader(:page) { at!('ul.page-list .current').inner_text.to_i } |
Class Method Details
.url(member_id, page = 1) ⇒ String
Returns the URL for given member_id
and page
17 18 19 |
# File 'lib/pixiv/owned_illust_list.rb', line 17 def self.url(member_id, page = 1) raise NotImplementError end |
Instance Method Details
#first? ⇒ Boolean
40 41 42 |
# File 'lib/pixiv/owned_illust_list.rb', line 40 def first? page == 1 end |
#max_size ⇒ Integer
55 56 57 |
# File 'lib/pixiv/owned_illust_list.rb', line 55 def max_size ILLUSTS_PER_PAGE end |
#next_url ⇒ String
45 46 47 |
# File 'lib/pixiv/owned_illust_list.rb', line 45 def next_url last? ? nil : self.class.url(member_id, page + 1) end |
#prev_url ⇒ String
50 51 52 |
# File 'lib/pixiv/owned_illust_list.rb', line 50 def prev_url first? ? nil : self.class.url(member_id, page - 1) end |
#url ⇒ String
35 36 37 |
# File 'lib/pixiv/owned_illust_list.rb', line 35 def url self.class.url(member_id, page) end |