Exception: NewsScraper::ResponseError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/news_scraper/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ ResponseError

Returns a new instance of ResponseError.



6
7
8
9
10
11
# File 'lib/news_scraper/errors.rb', line 6

def initialize(opts = {})
  @error_code = opts[:error_code]
  @message = opts[:message]
  @url = opts[:url]
  super
end

Instance Attribute Details

#error_codeObject (readonly)

Returns the value of attribute error_code.



4
5
6
# File 'lib/news_scraper/errors.rb', line 4

def error_code
  @error_code
end

#messageObject (readonly)

Returns the value of attribute message.



4
5
6
# File 'lib/news_scraper/errors.rb', line 4

def message
  @message
end

#urlObject (readonly)

Returns the value of attribute url.



4
5
6
# File 'lib/news_scraper/errors.rb', line 4

def url
  @url
end