Sha256: 67a92456158084f4c54b58ea9bf2100fb7009083d23559175e6f4b2469167880
Contents?: true
Size: 329 Bytes
Versions: 8
Compression:
Stored size: 329 Bytes
Contents
# frozen_string_literal: true module Meteoservice module NestedHashValue def nested_hash_value(obj, key) if obj.respond_to?(:key?) && obj.key?(key) obj[key] elsif obj.respond_to?(:each) r = nil obj.find { |*a| r = nested_hash_value(a.last, key) } r end end end end
Version data entries
8 entries across 8 versions & 1 rubygems