Exception: TriviaCrack::Errors::RequestError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, url, body) ⇒ RequestError

Public: Initializes a RequestError.

code - The HTTP status code returned by the Trivia Crack server. url - The URL that was requested. body - The response body that was returned by the Trivia Crack server.



21
22
23
24
25
# File 'lib/triviacrack/errors/request_error.rb', line 21

def initialize(code, url, body)
  @code = code
  @url = url
  @body = body
end

Instance Attribute Details

#bodyObject (readonly)

Public: The response body that was returned by the Trivia Crack server.



14
15
16
# File 'lib/triviacrack/errors/request_error.rb', line 14

def body
  @body
end

#codeObject (readonly)

Public: The HTTP status code returned by the Trivia Crack server.



8
9
10
# File 'lib/triviacrack/errors/request_error.rb', line 8

def code
  @code
end

#urlObject (readonly)

Public: The URL that was requested.



11
12
13
# File 'lib/triviacrack/errors/request_error.rb', line 11

def url
  @url
end