Class: NucleusCore::ResponseAdapter

Inherits:
SimpleObject show all
Defined in:
lib/nucleus_core/response_adapters/response_adapter.rb

Instance Attribute Summary

Attributes inherited from SimpleObject

#__attributes__

Instance Method Summary collapse

Methods inherited from SimpleObject

#to_h

Constructor Details

#initialize(attrs = {}) ⇒ ResponseAdapter

Returns a new instance of ResponseAdapter.



4
5
6
7
8
9
10
11
12
13
# File 'lib/nucleus_core/response_adapters/response_adapter.rb', line 4

def initialize(attrs={})
  attributes = defaults
    .merge(attrs)
    .slice(*defaults.keys)
    .tap do |hash|
      hash[:status] = status_code(hash[:status])
    end

  super(attributes)
end