Class: Lurch::Error

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

Constant Summary collapse

JSON_API_ERROR_FIELDS =
%w[id links about status code title detail source meta].freeze

Instance Method Summary collapse

Constructor Details

#initialize(error_object) ⇒ Error

Returns a new instance of Error.



7
8
9
10
11
# File 'lib/lurch/error.rb', line 7

def initialize(error_object)
  JSON_API_ERROR_FIELDS.each do |field|
    instance_variable_set("@#{field}", error_object[field])
  end
end