Exception: Zaikio::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/zaikio/error.rb

Direct Known Subclasses

ConnectionError, ResourceNotFound

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, **opts) ⇒ Error

Returns a new instance of Error.



3
4
5
6
7
8
9
10
11
# File 'lib/zaikio/error.rb', line 3

def initialize(message = nil, **opts)
  super(message)

  opts.each do |key, value|
    ivar = "@#{key}".to_sym
    instance_variable_set(ivar, value)
    define_singleton_method(key) { instance_variable_get(ivar) }
  end
end