Class: Bmg::Relation::InMemory

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

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, #with_typecheck, #without_typecheck, #ys_by_x

Methods included from Algebra

#allbut, #autosummarize, #autowrap, #constants, #extend, #group, #image, #join, #matching, #materialize, #not_matching, #page, #project, #rename, #restrict, #spied, #summarize, #union, #unspied

Methods included from Algebra::Shortcuts

#image, #join, #matching, #not_matching, #prefix, #rxmatch, #suffix

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.



12
13
14
# File 'lib/bmg/relation/in_memory.rb', line 12

def operand
  @operand
end

#typeObject

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



16
17
18
# File 'lib/bmg/relation/in_memory.rb', line 16

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

#inspectObject



28
29
30
# File 'lib/bmg/relation/in_memory.rb', line 28

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

#to_astObject



20
21
22
# File 'lib/bmg/relation/in_memory.rb', line 20

def to_ast
  [ :in_memory, operand ]
end

#to_sObject



24
25
26
# File 'lib/bmg/relation/in_memory.rb', line 24

def to_s
  "(in_memory ...)"
end