Class: Alf::Relvar::Virtual
- Inherits:
-
Object
- Object
- Alf::Relvar::Virtual
- Includes:
- Alf::Relvar
- Defined in:
- lib/alf-relvar/alf/relvar/virtual.rb
Instance Attribute Summary collapse
-
#expr ⇒ Object
readonly
Returns the value of attribute expr.
Attributes included from Support::Bindable
Instance Method Summary collapse
-
#delete(predicate = Predicate.tautology) ⇒ Object
Delete all tuples of this relation variable.
-
#heading ⇒ Object
Static analysis & inference.
-
#initialize(expr, connection = nil) ⇒ Virtual
constructor
A new instance of Virtual.
-
#insert(tuples) ⇒ Object
Inserts some tuples inside this relation variable.
- #keys ⇒ Object
-
#to_cog ⇒ Object
to_xxx.
- #to_lispy ⇒ Object
- #to_s ⇒ Object
-
#update(computation, predicate = Predicate.tautology) ⇒ Object
Updates all tuples of this relation variable.
Methods included from Alf::Relvar
#affect, #each, #empty!, #empty?, #lock, #not_empty!, #safe, #to_relation, #to_relvar, #type, #upsert, #value
Methods included from Lang::ObjectOriented
Methods included from Lang::ObjectOriented::RenderingMethods
def_renderer_method, #to_a, #to_array
Methods included from Lang::ObjectOriented::AlgebraMethods
#!~, #&, #*, #+, #-, #=~, #allbut, def_operator_method, #tuple_extract
Methods included from Lang::ObjectOriented::AggregationMethods
Methods included from Algebra::Operand
#attr_list, coerce, #to_dot, #to_relation
Methods included from Support::Bindable
Constructor Details
#initialize(expr, connection = nil) ⇒ Virtual
Returns a new instance of Virtual.
6 7 8 9 |
# File 'lib/alf-relvar/alf/relvar/virtual.rb', line 6 def initialize(expr, connection = nil) @expr = expr @connection = connection end |
Instance Attribute Details
#expr ⇒ Object (readonly)
Returns the value of attribute expr.
10 11 12 |
# File 'lib/alf-relvar/alf/relvar/virtual.rb', line 10 def expr @expr end |
Instance Method Details
#delete(predicate = Predicate.tautology) ⇒ Object
Delete all tuples of this relation variable.
36 37 38 |
# File 'lib/alf-relvar/alf/relvar/virtual.rb', line 36 def delete(predicate = Predicate.tautology) Update::Deleter.new.call(expr, predicate) end |
#heading ⇒ Object
Static analysis & inference
14 15 16 |
# File 'lib/alf-relvar/alf/relvar/virtual.rb', line 14 def heading expr.heading end |
#insert(tuples) ⇒ Object
Inserts some tuples inside this relation variable.
25 26 27 28 |
# File 'lib/alf-relvar/alf/relvar/virtual.rb', line 25 def insert(tuples) tuples = [ tuples ] if TupleLike===tuples Update::Inserter.new.call(expr, tuples) end |
#keys ⇒ Object
18 19 20 |
# File 'lib/alf-relvar/alf/relvar/virtual.rb', line 18 def keys expr.keys end |
#to_cog ⇒ Object
to_xxx
42 43 44 |
# File 'lib/alf-relvar/alf/relvar/virtual.rb', line 42 def to_cog connection!.cog(expr) end |
#to_lispy ⇒ Object
46 47 48 |
# File 'lib/alf-relvar/alf/relvar/virtual.rb', line 46 def to_lispy expr.to_lispy end |
#to_s ⇒ Object
50 51 52 |
# File 'lib/alf-relvar/alf/relvar/virtual.rb', line 50 def to_s "Relvar::Virtual(#{expr})" end |
#update(computation, predicate = Predicate.tautology) ⇒ Object
Updates all tuples of this relation variable.
31 32 33 |
# File 'lib/alf-relvar/alf/relvar/virtual.rb', line 31 def update(computation, predicate = Predicate.tautology) Update::Updater.new.call(expr, computation, predicate) end |