# Defines additional methods to make Fixture behave like a Hash. Required for resolving joins. # # Accomodates both of the allowed internal data structures for Fixture: Hash and YAML::Omap class Fixture def has_key?(key) # should work for Hash and Omap @fixture.keys.include?(key) end def each_pair(&block) if @fixture.respond_to?(:each_pair) # for Hash @fixture.each_pair(&block) else # for Omap @fixture.map { |key, value| yield(key, value) } end end def delete_if(&block) # should work for Hash and Omap @fixture.delete_if(&block) end def []=(key, value) @fixture[key] = value end end