Class: Hash

Inherits:
Object show all
Defined in:
lib/dorian/to_struct.rb

Instance Method Summary collapse

Instance Method Details

#to_deep_structObject



34
35
36
# File 'lib/dorian/to_struct.rb', line 34

def to_deep_struct
  Struct.new(*keys.map(&:to_sym)).new(*values.map(&:to_deep_struct))
end

#to_structObject



30
31
32
# File 'lib/dorian/to_struct.rb', line 30

def to_struct
  Struct.new(*keys.map(&:to_sym)).new(*values)
end