Class: MangafoxChapter
Instance Attribute Summary
#custom_data, #manga, #number, #parsed_html, #uri, #url
Class Method Summary
collapse
Instance Method Summary
collapse
#initialize, #pages
Constructor Details
This class inherits a constructor from ChapterCrawler
Class Method Details
.page_class ⇒ Object
11
12
13
|
# File 'lib/yamd/mangafox.rb', line 11
def self.page_class
MangafoxPage
end
|
Instance Method Details
#name ⇒ Object
30
31
32
|
# File 'lib/yamd/mangafox.rb', line 30
def name
@custom_data[:name]
end
|
#pages_info ⇒ Object
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/yamd/mangafox.rb', line 15
def pages_info
page_options = @parsed_html.at_css('.prev_page + div > select').css('option')
pages_number = page_options.map { | option | option['value'].to_i }.max
chapter_base_url = Addressable::URI.parse(self.url)
chapter_base_path, _ = Pathname.new(chapter_base_url.path).split
page_urls = (1..pages_number).to_a.map do | i |
chapter_base_url.path = chapter_base_path.join("#{i}.html").to_s
{ url: chapter_base_url.to_s }
end
page_urls
end
|