Module: RGeo::ImplHelper::Utils

Defined in:
lib/rgeo/impl_helper/utils.rb

Overview

:nodoc:

Class Method Summary collapse

Class Method Details

.stringize_hash(hash_) ⇒ Object


45
46
47
48
49
50
51
# File 'lib/rgeo/impl_helper/utils.rb', line 45

def stringize_hash(hash_)
  nhash_ = {}
  hash_.each do |k_, v_|
    nhash_[k_.is_a?(::Symbol) ? k_.to_s : k_] = v_.is_a?(::Symbol) ? v_.to_s : v_
  end
  nhash_
end

.symbolize_hash(hash_) ⇒ Object


53
54
55
56
57
58
59
# File 'lib/rgeo/impl_helper/utils.rb', line 53

def symbolize_hash(hash_)
  nhash_ = {}
  hash_.each do |k_, v_|
    nhash_[k_.is_a?(::String) ? k_.to_sym : k_] = v_.is_a?(::String) ? v_.to_sym : v_
  end
  nhash_
end