Exception: Gh::Trending::Parsers::HtmlChangedError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/gh_trending/parsers/html_changed_error.rb

Overview

Class indicating that perhaps the HTML of the trending has changed for whatever reason.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(page_that_changed, msg = nil) ⇒ HtmlChangedError

Returns a new instance of HtmlChangedError.



11
12
13
14
15
16
17
18
19
# File 'lib/gh_trending/parsers/html_changed_error.rb', line 11

def initialize(page_that_changed, msg = nil)
  @page_that_changed = page_that_changed
  page_changed_human_format = build_human_format_page_changed

  msg ||= 'The page can\'t be crawled anymore because' \
          "#{page_changed_human_format} changed its HTML format." \
          'Submit a PR to fix it!'
  super(msg)
end

Instance Attribute Details

#page_that_changedObject (readonly)

Returns the value of attribute page_that_changed.



9
10
11
# File 'lib/gh_trending/parsers/html_changed_error.rb', line 9

def page_that_changed
  @page_that_changed
end