Sha256: 5b14d09dfe1e0490580903b57d08a63b44f47f9d7ff0565f3a47986a7737f9d9

Contents?: true

Size: 592 Bytes

Versions: 17

Compression:

Stored size: 592 Bytes

Contents

module ActiveGraph
  module Core
    module Result
      attr_writer :wrap

      def keys
        @keys ||= super
      end

      def wrap?
        @wrap
      end

      def each(&block)
        store if wrap? # TODO: why? This is preventing streaming
        @records&.each(&block) || super
      end

      def store
        return if @records
        keys
        @records = []
        # TODO: implement 'each' without block parameter
        method(:each).super_method.call do |record|
          record.wrap = wrap?
          @records << record
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
activegraph-11.4.0 lib/active_graph/core/result.rb
activegraph-11.3.1 lib/active_graph/core/result.rb
activegraph-11.3.0 lib/active_graph/core/result.rb
activegraph-11.2.0 lib/active_graph/core/result.rb
activegraph-11.1.0 lib/active_graph/core/result.rb
activegraph-11.1.0.beta.1 lib/active_graph/core/result.rb
activegraph-11.1.0.alpha.4 lib/active_graph/core/result.rb
activegraph-11.1.0.alpha.3 lib/active_graph/core/result.rb
activegraph-11.1.0.alpha.2 lib/active_graph/core/result.rb
activegraph-11.1.0.alpha.1 lib/active_graph/core/result.rb
activegraph-11.0.2-java lib/active_graph/core/result.rb
activegraph-11.0.1-java lib/active_graph/core/result.rb
activegraph-11.0.0-java lib/active_graph/core/result.rb
activegraph-11.0.0.beta.4-java lib/active_graph/core/result.rb
activegraph-11.0.0.beta.3-java lib/active_graph/core/result.rb
activegraph-11.0.0.beta.2-java lib/active_graph/core/result.rb
activegraph-11.0.0.beta.1-java lib/active_graph/core/result.rb