Exception: RubyBox::RubyBoxError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/ruby-box/exceptions.rb

Direct Known Subclasses

AuthError, ItemNameInUse, RequestError, ServerError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error_json, status, body) ⇒ RubyBoxError

Returns a new instance of RubyBoxError.



5
6
7
8
9
# File 'lib/ruby-box/exceptions.rb', line 5

def initialize(error_json, status, body)
  @status = status
  @body = body
  @error_json = error_json
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



3
4
5
# File 'lib/ruby-box/exceptions.rb', line 3

def body
  @body
end

#statusObject

Returns the value of attribute status.



3
4
5
# File 'lib/ruby-box/exceptions.rb', line 3

def status
  @status
end

Instance Method Details

#[](key) ⇒ Object



11
12
13
# File 'lib/ruby-box/exceptions.rb', line 11

def [](key)
  @error_json[key]
end