Class: Bmg::Relation::Spied

Inherits:
Object
  • Object
show all
Includes:
Operator::Unary
Defined in:
lib/bmg/relation/spied.rb

Constant Summary

Constants included from Algebra

Algebra::METHODS

Instance Attribute Summary

Attributes included from Operator::Unary

#operand

Instance Method Summary collapse

Methods included from Operator::Unary

#_visit, #operands

Methods included from Operator

#inspect, #to_s

Methods included from Bmg::Relation

#debug, empty, #empty?, new, #one, #one_or_nil, #to_json, #visit, #ys_by_x

Methods included from Algebra

#allbut, #autosummarize, #autowrap, #constants, #extend, #matching, #project, #rename, #restrict, #spied

Constructor Details

#initialize(operand, spy) ⇒ Spied

Returns a new instance of Spied.



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

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

Instance Method Details

#delete(*args, &bl) ⇒ Object



56
57
58
# File 'lib/bmg/relation/spied.rb', line 56

def delete(*args, &bl)
  operand.delete(*args, &bl)
end

#each(&bl) ⇒ Object



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

def each(&bl)
  spy.call(self)
  operand.each(&bl)
end

#image(right, *args) ⇒ Object



38
39
40
# File 'lib/bmg/relation/spied.rb', line 38

def image(right, *args)
  operand.image(right.unspied, *args).spied(spy)
end

#insert(*args, &bl) ⇒ Object



52
53
54
# File 'lib/bmg/relation/spied.rb', line 52

def insert(*args, &bl)
  operand.insert(*args, &bl)
end

#to_astObject



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

def to_ast
  [ :spied, operand.to_ast, spy ]
end

#typeObject



17
18
19
# File 'lib/bmg/relation/spied.rb', line 17

def type
  operand.type
end

#union(right, *args) ⇒ Object



42
43
44
# File 'lib/bmg/relation/spied.rb', line 42

def union(right, *args)
  operand.union(right.unspied, *args).spied(spy)
end

#unspiedObject



46
47
48
# File 'lib/bmg/relation/spied.rb', line 46

def unspied
  operand
end

#update(*args, &bl) ⇒ Object



60
61
62
# File 'lib/bmg/relation/spied.rb', line 60

def update(*args, &bl)
  operand.update(*args, &bl)
end