Sha256: ca1c85748d541d1568239721209482ec094e474bfc0cf8facd18dda960f3a222
Contents?: true
Size: 451 Bytes
Versions: 11
Compression:
Stored size: 451 Bytes
Contents
require 'hashie' class Musterb::HashExtractor attr_reader :parent, :value def initialize(value, parent) @value = to_string_access(value) @parent = parent end def [](symbol) if @value.has_key? symbol @value[symbol] else @parent[symbol] end end private def to_string_access(hash) hash.dup.tap do |hash| hash.extend Hashie::HashExtensions hash.hashie_stringify_keys! end end end
Version data entries
11 entries across 11 versions & 1 rubygems