Exception: Moneta::Api::RuntimeException

Inherits:
Exception
  • Object
show all
Defined in:
lib/moneta/api/runtime_exception.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#codeObject

Returns the value of attribute code.



4
5
6
# File 'lib/moneta/api/runtime_exception.rb', line 4

def code
  @code
end

#detailObject

Returns the value of attribute detail.



4
5
6
# File 'lib/moneta/api/runtime_exception.rb', line 4

def detail
  @detail
end

Instance Method Details

#inspectObject



6
7
8
9
10
# File 'lib/moneta/api/runtime_exception.rb', line 6

def inspect
  error = [ "#{ code }: #{ message }" ]
  error += detail.collect { |key, value| "#{ key }: #{ Array(value).join($/) }" }
  error.join($/)
end

#to_hashObject



12
13
14
15
16
17
18
# File 'lib/moneta/api/runtime_exception.rb', line 12

def to_hash
  {
    code: code,
    message: message,
    detail: detail
  }
end