Exception: Libis::Services::HttpError

Inherits:
Exception
  • Object
show all
Defined in:
lib/libis/services/http_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error) ⇒ HttpError

Returns a new instance of HttpError.



9
10
11
12
13
# File 'lib/libis/services/http_error.rb', line 9

def initialize(error)
  @code = error[:code]
  @header = error[:header]
  @body = error[:body]
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



7
8
9
# File 'lib/libis/services/http_error.rb', line 7

def body
  @body
end

#codeObject

Returns the value of attribute code.



7
8
9
# File 'lib/libis/services/http_error.rb', line 7

def code
  @code
end

#headerObject

Returns the value of attribute header.



7
8
9
# File 'lib/libis/services/http_error.rb', line 7

def header
  @header
end

Instance Method Details

#messageObject



15
16
17
# File 'lib/libis/services/http_error.rb', line 15

def message
  code.to_s
end