Class: Bmg::Relation::InMemory

Inherits:
Object
  • Object
show all
Includes:
Bmg::Relation
Defined in:
lib/bmg/relation/in_memory.rb

Constant Summary

Constants included from Algebra

Algebra::METHODS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Bmg::Relation

#debug, #delete, empty, #empty?, #insert, new, #one, #one_or_nil, #to_json, #update, #visit, #ys_by_x

Methods included from Algebra

#allbut, #autosummarize, #autowrap, #constants, #extend, #group, #image, #matching, #page, #project, #rename, #restrict, #rxmatch, #spied, #union, #unspied

Constructor Details

#initialize(type, operand) ⇒ InMemory

Returns a new instance of InMemory.



6
7
8
9
# File 'lib/bmg/relation/in_memory.rb', line 6

def initialize(type, operand)
  @operand = operand
  @type = type
end

Instance Attribute Details

#operandObject (readonly)

Returns the value of attribute operand.



10
11
12
# File 'lib/bmg/relation/in_memory.rb', line 10

def operand
  @operand
end

#typeObject (readonly)

Returns the value of attribute type.



10
11
12
# File 'lib/bmg/relation/in_memory.rb', line 10

def type
  @type
end

Instance Method Details

#each(&bl) ⇒ Object



14
15
16
# File 'lib/bmg/relation/in_memory.rb', line 14

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

#inspectObject



26
27
28
# File 'lib/bmg/relation/in_memory.rb', line 26

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

#to_astObject



18
19
20
# File 'lib/bmg/relation/in_memory.rb', line 18

def to_ast
  [ :in_memory, operand ]
end

#to_sObject



22
23
24
# File 'lib/bmg/relation/in_memory.rb', line 22

def to_s
  "(in_memory ...)"
end