Class: HentaiCafeChapter

Inherits:
ChapterCrawler show all
Defined in:
lib/yamd/hentaicafe.rb

Instance Attribute Summary

Attributes inherited from ChapterCrawler

#custom_data, #manga, #number, #parsed_html, #uri, #url

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ChapterCrawler

#initialize, #pages

Constructor Details

This class inherits a constructor from ChapterCrawler

Class Method Details

.page_classObject



10
11
12
# File 'lib/yamd/hentaicafe.rb', line 10

def self.page_class
  HentaiCafePage
end

Instance Method Details

#nameObject



24
25
26
# File 'lib/yamd/hentaicafe.rb', line 24

def name
  @custom_data[:name]
end

#pages_infoObject



14
15
16
17
18
19
20
21
22
# File 'lib/yamd/hentaicafe.rb', line 14

def pages_info
  # there's no need of an lazy enumerator here, no IO action is taken
  page_list = @parsed_html.at_css('ul.dropdown').css('li')
  page_urls = []
  page_list.each do | li_el |
    page_urls << { url: li_el.css('a').first['href'] }
  end
  page_urls
end