Class: Alf::Relvar::Base
- Inherits:
-
Object
- Object
- Alf::Relvar::Base
- Includes:
- Alf::Relvar
- Defined in:
- lib/alf-relvar/alf/relvar/base.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes included from Support::Bindable
Instance Method Summary collapse
- #delete(predicate = Predicate.tautology) ⇒ Object
-
#heading ⇒ Object
Static analysis & inference.
-
#initialize(name, connection = nil) ⇒ Base
constructor
A new instance of Base.
- #insert(tuples) ⇒ Object
- #keys ⇒ Object
-
#lock(mode = :exclusive, &bl) ⇒ Object
Update.
-
#to_cog ⇒ Object
to_xxx.
- #to_lispy ⇒ Object
- #to_s ⇒ Object
- #update(updating, predicate = Predicate.tautology) ⇒ Object
Methods included from Alf::Relvar
#affect, #each, #empty!, #empty?, #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(name, connection = nil) ⇒ Base
Returns a new instance of Base.
6 7 8 9 10 |
# File 'lib/alf-relvar/alf/relvar/base.rb', line 6 def initialize(name, connection = nil) raise unless name.is_a?(Symbol) @name = name @connection = connection end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
11 12 13 |
# File 'lib/alf-relvar/alf/relvar/base.rb', line 11 def name @name end |
Instance Method Details
#delete(predicate = Predicate.tautology) ⇒ Object
34 35 36 |
# File 'lib/alf-relvar/alf/relvar/base.rb', line 34 def delete(predicate = Predicate.tautology) connection!.delete(name, predicate) end |
#heading ⇒ Object
Static analysis & inference
15 16 17 |
# File 'lib/alf-relvar/alf/relvar/base.rb', line 15 def heading connection!.heading(name) end |
#insert(tuples) ⇒ Object
29 30 31 32 |
# File 'lib/alf-relvar/alf/relvar/base.rb', line 29 def insert(tuples) tuples = [ tuples ] if TupleLike===tuples connection!.insert(name, tuples) end |
#keys ⇒ Object
19 20 21 |
# File 'lib/alf-relvar/alf/relvar/base.rb', line 19 def keys connection!.keys(name) end |
#lock(mode = :exclusive, &bl) ⇒ Object
Update
25 26 27 |
# File 'lib/alf-relvar/alf/relvar/base.rb', line 25 def lock(mode = :exclusive, &bl) connection!.lock(name, mode, &bl) end |
#to_cog ⇒ Object
to_xxx
44 45 46 |
# File 'lib/alf-relvar/alf/relvar/base.rb', line 44 def to_cog connection!.cog(name) end |
#to_lispy ⇒ Object
48 49 50 |
# File 'lib/alf-relvar/alf/relvar/base.rb', line 48 def to_lispy name.to_s end |
#to_s ⇒ Object
52 53 54 |
# File 'lib/alf-relvar/alf/relvar/base.rb', line 52 def to_s "Relvar::Base(#{name.inspect})" end |