class Bmg::Relation::Empty

The empty relation, of a given type.

This relation implementation exists mostly for optimization purposes, since knowing that a relation is empty allows simplifying many expressions.

Attributes

type[RW]

Public Class Methods

new(type) click to toggle source
# File lib/bmg/relation/empty.rb, line 13
def initialize(type)
  @type = type
end

Public Instance Methods

_count() click to toggle source
# File lib/bmg/relation/empty.rb, line 22
def _count
  0
end
each(&bl) click to toggle source
# File lib/bmg/relation/empty.rb, line 19
def each(&bl)
end
inspect() click to toggle source
# File lib/bmg/relation/empty.rb, line 34
def inspect
  "(empty)"
end
to_ast() click to toggle source
# File lib/bmg/relation/empty.rb, line 26
def to_ast
  [ :empty ]
end
to_s() click to toggle source
# File lib/bmg/relation/empty.rb, line 30
def to_s
  "(empty)"
end