Exception: VingdError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/vingd/exceptions.rb

Direct Known Subclasses

Forbidden, InternalError, InvalidData, NotFound

Constant Summary collapse

DEFAULT_CONTEXT =
"Error"
DEFAULT_CODE =
Codes::CONFLICT

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context = nil, code = nil) ⇒ VingdError

Returns a new instance of VingdError.



7
8
9
10
# File 'lib/vingd/exceptions.rb', line 7

def initialize(context=nil, code=nil)
  @context = (context or self.class::DEFAULT_CONTEXT)
  @code = (code or self.class::DEFAULT_CODE)
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



4
5
6
# File 'lib/vingd/exceptions.rb', line 4

def code
  @code
end

#contextObject (readonly)

Returns the value of attribute context.



4
5
6
# File 'lib/vingd/exceptions.rb', line 4

def context
  @context
end