Sha256: 2ecedd17fd2285cc1dde517fde4003265f60b49abc3226f32e50e9ec1b17e4da

Contents?: true

Size: 771 Bytes

Versions: 14

Compression:

Stored size: 771 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
require_relative 'in_memory/mutable'

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
bmg-0.23.3 lib/bmg/relation/in_memory.rb
bmg-0.23.2 lib/bmg/relation/in_memory.rb
bmg-0.23.1 lib/bmg/relation/in_memory.rb
bmg-0.23.0 lib/bmg/relation/in_memory.rb
bmg-0.21.5 lib/bmg/relation/in_memory.rb
bmg-0.21.4 lib/bmg/relation/in_memory.rb
bmg-0.20.5 lib/bmg/relation/in_memory.rb
bmg-0.21.3 lib/bmg/relation/in_memory.rb
bmg-0.21.2 lib/bmg/relation/in_memory.rb
bmg-0.21.0 lib/bmg/relation/in_memory.rb
bmg-0.20.4 lib/bmg/relation/in_memory.rb
bmg-0.20.2 lib/bmg/relation/in_memory.rb
bmg-0.20.1 lib/bmg/relation/in_memory.rb
bmg-0.20.0 lib/bmg/relation/in_memory.rb