Class: Pixiv::BookmarkList

Inherits:
OwnedIllustList show all
Defined in:
lib/pixiv/bookmark_list.rb

Direct Known Subclasses

PrivateBookmarkList

Constant Summary

Constants inherited from OwnedIllustList

OwnedIllustList::ILLUSTS_PER_PAGE

Instance Attribute Summary

Attributes inherited from OwnedIllustList

#last?, #member_id, #page

Attributes inherited from IllustList

#page

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from OwnedIllustList

#first?, #max_size, #next_url, #prev_url, #url

Methods inherited from IllustList

#doc, #illust_hashes, #page_class

Methods included from PageCollection

#first?, #last?, #next_attrs, #next_url, #page_class, #prev_attrs, #prev_url, #size

Methods inherited from Page

#bind, #doc, #fetched?, #force, #initialize, lazy_new

Constructor Details

This class inherits a constructor from Pixiv::Page

Class Method Details

.url(member_id, page = 1) ⇒ Object



4
5
6
# File 'lib/pixiv/bookmark_list.rb', line 4

def self.url(member_id, page = 1)
  "#{ROOT_URL}/bookmark.php?id=#{member_id}&rest=show&p=#{page}"
end

Instance Method Details

#page_hashesArray<Hash{Symbol=>Object}, nil>

Returns:

  • (Array<Hash{Symbol=>Object}, nil>)


14
15
16
# File 'lib/pixiv/bookmark_list.rb', line 14

lazy_attr_reader(:page_hashes) {
  search!('li[id^="li_"]').map {|n| hash_from_list_item(n) }
}

#total_countInteger Also known as: bookmarks_count

Returns:

  • (Integer)


9
10
11
12
# File 'lib/pixiv/bookmark_list.rb', line 9

lazy_attr_reader(:total_count) {
  node = at!('a[href="/bookmark.php?type=illust_all"]')
  node.inner_text[/\d+/].to_i
}