Class: Array

Inherits:
Object
  • Object
show all
Includes:
Metanorma::Utils::Array
Defined in:
lib/metanorma/cli/stringify_all_keys.rb

Instance Method Summary collapse

Instance Method Details

#stringify_all_keysObject



2
3
4
5
6
7
8
9
10
11
# File 'lib/metanorma/cli/stringify_all_keys.rb', line 2

def stringify_all_keys
  map do |v|
    case v
    when Hash, Array
      v.stringify_all_keys
    else
      v
    end
  end
end

#symbolize_all_keysObject



13
14
15
16
17
18
19
20
21
22
# File 'lib/metanorma/cli/stringify_all_keys.rb', line 13

def symbolize_all_keys
  map do |v|
    case v
    when Hash, Array
      v.symbolize_all_keys
    else
      v
    end
  end
end