lib/moneta/api/runtime_exception.rb in moneta-api-1.8.0 vs lib/moneta/api/runtime_exception.rb in moneta-api-1.9.0
- old
+ new
@@ -1,18 +1,11 @@
module Moneta
module Api
class RuntimeException < Exception
- attr_reader :code, :detail
+ attr_accessor :code, :detail
- def initialize(code, message, detail)
- super(message)
-
- @code = code
- @detail = detail
- end
-
def inspect
- error = [ "#{ @code }: #{ message }" ]
+ error = [ "#{ code }: #{ message }" ]
error += detail.collect { |key, value| "#{ key }: #{ Array(value).join($/) }" }
error.join($/)
end
def to_hash