Class: Alf::Relvar::Virtual

Inherits:
Object
  • Object
show all
Includes:
Alf::Relvar
Defined in:
lib/alf/relvar/virtual.rb

Instance Attribute Summary

Attributes included from Alf::Relvar

#expr

Instance Method Summary collapse

Methods included from Alf::Relvar

#affect, #each, #empty!, #empty?, #initialize, #lock, #not_empty!, #safe, #size, #to_relation, #to_relvar, #type, #upsert, #value

Methods included from Lang::ObjectOriented

new

Methods included from Lang::ObjectOriented::RenderingMethods

def_renderer_method, #to_a, #to_array

Methods included from Lang::ObjectOriented::AlgebraMethods

#!~, #&, #*, #+, #-, #=~, def_operator_method, #tuple_extract

Methods included from Lang::ObjectOriented::AggregationMethods

def_aggregator_method

Methods included from Algebra::Operand

#attr_list, coerce, #heading, #keys, #resulting_type, #to_ascii_tree, #to_cog, #to_relation, #type_check

Instance Method Details

#delete(predicate = Predicate.tautology) ⇒ Object

Delete all tuples of this relation variable.


18
19
20
# File 'lib/alf/relvar/virtual.rb', line 18

def delete(predicate = Predicate.tautology)
  Update::Deleter.new.call(expr, predicate)
end

#insert(tuples) ⇒ Object

Inserts some tuples inside this relation variable.


7
8
9
10
# File 'lib/alf/relvar/virtual.rb', line 7

def insert(tuples)
  tuples = [ tuples ] if TupleLike===tuples
  Update::Inserter.new.call(expr, tuples)
end

#to_sObject

to_xxx


24
25
26
# File 'lib/alf/relvar/virtual.rb', line 24

def to_s
  "Relvar::Virtual(#{expr})"
end

#update(computation, predicate = Predicate.tautology) ⇒ Object

Updates all tuples of this relation variable.


13
14
15
# File 'lib/alf/relvar/virtual.rb', line 13

def update(computation, predicate = Predicate.tautology)
  Update::Updater.new.call(expr, computation, predicate)
end