Class: MangahereChapter

Inherits:
ChapterCrawler show all
Defined in:
lib/yamd/gehentai.rb,
lib/yamd/mangahere.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/gehentai.rb', line 10

def self.page_class
  MangaherePage
end

Instance Method Details

#nameObject



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

def name
  @custom_data[:name]
end

#pages_infoObject



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

def pages_info
  # there's no need of an lazy enumerator here, no IO action is taken
  page_options = @parsed_html.at_css('.prew_page + select').css('option')
  page_urls = []
  page_options.each do | option |
    page_urls << { url: option['value'] }
  end
  page_urls
end