Exception: Blodsband::Error

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/blodsband/error.rb

Overview

A class that collects a single HTTP based error.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(http) ⇒ Error

Returns a new instance of Error.



9
10
11
12
# File 'lib/blodsband/error.rb', line 9

def initialize(http)
  @status = http.response_header.status
  @response = http.response
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



8
9
10
# File 'lib/blodsband/error.rb', line 8

def response
  @response
end

#statusObject (readonly)

Returns the value of attribute status.



8
9
10
# File 'lib/blodsband/error.rb', line 8

def status
  @status
end

Instance Method Details

#to_sObject



13
14
15
# File 'lib/blodsband/error.rb', line 13

def to_s
  "#{@response}: #{@status}"
end