Class: ActiveJson::Hash

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/active_json/hash.rb

Instance Method Summary collapse

Instance Method Details

#to_hObject



3
4
5
6
7
8
9
10
# File 'lib/active_json/hash.rb', line 3

def to_h
  super.map do |key, value|
    [
      key,
      STRUCTURES.any? { |s| value.is_a?(s) } ? value.to_h : value
    ]
  end.to_h
end