Class: PageCrawler

Inherits:
Object
  • Object
show all
Defined in:
lib/yamd.rb

Direct Known Subclasses

MangafoxPage, MangaherePage

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(custom_data, parsed_html, number, chapter) ⇒ PageCrawler

Returns a new instance of PageCrawler.



9
10
11
12
13
14
15
# File 'lib/yamd.rb', line 9

def initialize(custom_data, parsed_html, number, chapter)
  @custom_data = custom_data
  @url = custom_data[:url]
  @parsed_html = parsed_html
  @number = number
  @chapter = chapter
end

Instance Attribute Details

#chapterObject (readonly)

Returns the value of attribute chapter.



7
8
9
# File 'lib/yamd.rb', line 7

def chapter
  @chapter
end

#custom_dataObject (readonly)

Returns the value of attribute custom_data.



7
8
9
# File 'lib/yamd.rb', line 7

def custom_data
  @custom_data
end

#numberObject (readonly)

Returns the value of attribute number.



7
8
9
# File 'lib/yamd.rb', line 7

def number
  @number
end

#parsed_htmlObject (readonly)

Returns the value of attribute parsed_html.



7
8
9
# File 'lib/yamd.rb', line 7

def parsed_html
  @parsed_html
end

#urlObject (readonly)

Returns the value of attribute url.



7
8
9
# File 'lib/yamd.rb', line 7

def url
  @url
end

Instance Method Details

#image_urlObject



17
18
19
# File 'lib/yamd.rb', line 17

def image_url
  fail 'This method is abstract and have to be defined in a subclass.'
end