Class: Hash
Instance Method Summary collapse
Instance Method Details
#filter_data ⇒ Object
2 3 4 5 6 7 8 9 10 11 |
# File 'lib/watchdocs/rails/core_extensions/hash.rb', line 2 def filter_data filtered = map do |k, v| if v.is_a?(Enumerable) [k, v.filter_data] else [k, v.json_data_type] end end Hash[filtered] end |
#upcased_keys ⇒ Object
13 14 15 |
# File 'lib/watchdocs/rails/core_extensions/hash.rb', line 13 def upcased_keys map { |k, _v| k.upcase } end |