def each_resource(type)
            target = self.is_a?(Resources) ? self : (self.Resources ||= Resources.new)

            rsrc = (target[type] and target[type].solve)

            return enum_for(__method__, type) { rsrc.is_a?(Dictionary) ? rsrc.length : 0 } unless block_given?
            return unless rsrc.is_a?(Dictionary)

            rsrc.each_pair do |name, obj|
                yield(name.value, obj.solve)
            end
        end
def each_resource(type)
            target = self.is_a?(Resources) ? self : (self.Resources ||= Resources.new)

            rsrc = (target[type] and target[type].solve)

            return enum_for(__method__, type) { rsrc.is_a?(Dictionary) ? rsrc.length : 0 } unless block_given?
            return unless rsrc.is_a?(Dictionary)

            rsrc.each_pair do |name, obj|
                yield(name.value, obj.solve)
            end
        end
Iterates over the resources by _type_.