Sha256: 298f191e0eebf30ab6ce131fab5bddab0fe75e4be65918b4d8b98aa6b7e5ddf0

Contents?: true

Size: 734 Bytes

Versions: 17

Compression:

Stored size: 734 Bytes

Contents

module Bmg
  module Relation
    class InMemory
      include Relation

      def initialize(type, operand)
        @operand = operand
        @type = type
      end
      attr_accessor :type
      attr_reader :operand

    public

      def each(&bl)
        @operand.each(&bl)
      end

      def _count
        if operand.respond_to?(:count)
          operand.count
        elsif operand.respond_to?(:size)
          operand.size
        else
          super
        end
      end

      def to_ast
        [ :in_memory, operand ]
      end

      def to_s
        "(in_memory ...)"
      end

      def inspect
        "(in_memory #{operand.inspect})"
      end

    end # class InMemory
  end # module Relation
end # module Bmg

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
bmg-0.19.3 lib/bmg/relation/in_memory.rb
bmg-0.19.2 lib/bmg/relation/in_memory.rb
bmg-0.19.1 lib/bmg/relation/in_memory.rb
bmg-0.19.0 lib/bmg/relation/in_memory.rb
bmg-0.18.15 lib/bmg/relation/in_memory.rb
bmg-0.18.14 lib/bmg/relation/in_memory.rb
bmg-0.18.13 lib/bmg/relation/in_memory.rb
bmg-0.18.12 lib/bmg/relation/in_memory.rb
bmg-0.18.11 lib/bmg/relation/in_memory.rb
bmg-0.18.10 lib/bmg/relation/in_memory.rb
bmg-0.18.9 lib/bmg/relation/in_memory.rb
bmg-0.18.8 lib/bmg/relation/in_memory.rb
bmg-0.18.7 lib/bmg/relation/in_memory.rb
bmg-0.18.6 lib/bmg/relation/in_memory.rb
bmg-0.18.5 lib/bmg/relation/in_memory.rb
bmg-0.18.4 lib/bmg/relation/in_memory.rb
bmg-0.18.3 lib/bmg/relation/in_memory.rb