Exception: NationalRail::ParseError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/national-rail/journey_planner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(original_exception, page_html) ⇒ ParseError

Returns a new instance of ParseError.



12
13
14
15
16
# File 'lib/national-rail/journey_planner.rb', line 12

def initialize(original_exception, page_html)
  super(original_exception.message)
  @original_exception, @page_html = original_exception, page_html
  set_backtrace(@original_exception.backtrace)
end

Instance Attribute Details

#original_exceptionObject (readonly)

Returns the value of attribute original_exception.



11
12
13
# File 'lib/national-rail/journey_planner.rb', line 11

def original_exception
  @original_exception
end

#page_htmlObject (readonly)

Returns the value of attribute page_html.



11
12
13
# File 'lib/national-rail/journey_planner.rb', line 11

def page_html
  @page_html
end

Instance Method Details

#inspectObject



17
18
19
# File 'lib/national-rail/journey_planner.rb', line 17

def inspect
  "#{self.class} wrapping #{@original_exception.inspect}"
end