Sha256: 4dddd67dcafc867f26aeed6a879bd2850413463ee991b32f4ed1ca3381f3f3f4

Contents?: true

Size: 390 Bytes

Versions: 5

Compression:

Stored size: 390 Bytes

Contents

Hash.class_eval do
  #take keys of hash and transform those to a symbols
  def self.symbolize_keys(item)
    if item.class == Hash
      item.to_options!
      item.each do |key, value|
        self.symbolize_keys(value)
      end
    elsif item.class == Array
      item.each do |array_val|
        self.symbolize_keys(array_val)
      end
    end

    item
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
erp_base_erp_svcs-3.0.4 lib/erp_base_erp_svcs/extensions/core/hash.rb
erp_base_erp_svcs-3.0.3 lib/erp_base_erp_svcs/extensions/core/hash.rb
erp_base_erp_svcs-3.0.2 lib/erp_base_erp_svcs/extensions/core/hash.rb
erp_base_erp_svcs-3.0.1 lib/erp_base_erp_svcs/extensions/core/hash.rb
erp_base_erp_svcs-3.0.0 lib/erp_base_erp_svcs/extensions/core/hash.rb