Class: OpenStruct

Inherits:
Object show all
Defined in:
lib/italian/ruby/metodi/open_struct.rb

Instance Method Summary collapse

Instance Method Details

#in_mappa(*args) ⇒ Object

Converte la mappa aperta in una mappa normale.



8
9
10
11
12
13
14
15
16
17
# File 'lib/italian/ruby/metodi/open_struct.rb', line 8

def in_mappa(*args)
  hash = to_h *args
  hash.in_mappa do |key, value|
    if value.is_a? OpenStruct
      [ key, value.to_h ]
    else
      [ key, value ]
    end
  end
end