Class: MangafoxCrawler

Inherits:
MangaCrawler show all
Defined in:
lib/yamd/mangafox.rb

Instance Attribute Summary

Attributes inherited from MangaCrawler

#parsed_html, #uri, #url

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from MangaCrawler

#chapters, #initialize

Constructor Details

This class inherits a constructor from MangaCrawler

Class Method Details

.chapter_classObject



48
49
50
# File 'lib/yamd/mangafox.rb', line 48

def self.chapter_class
  MangafoxChapter
end

Instance Method Details

#chapters_infoObject



36
37
38
39
40
41
42
43
44
45
46
# File 'lib/yamd/mangafox.rb', line 36

def chapters_info
  @parsed_html.css('#chapters ul li div').reverse.map do | chapter_link |
    name = chapter_link.at_css('a.tips').text
    # the real chapter name not always exist
    span_with_real_name = chapter_link.at_css('a.tips + span')
    name = name + ' - ' + span_with_real_name.text if span_with_real_name
    { name: name,
      url: chapter_link.at_css('a.tips')['href']
    }
  end
end

#nameObject



52
53
54
# File 'lib/yamd/mangafox.rb', line 52

def name
  @parsed_html.at_css('h1').text.match(/(.+) Manga/)[1]
end