Class: Alf::Relvar::ReadOnly
- Inherits:
-
Object
- Object
- Alf::Relvar::ReadOnly
show all
- Includes:
- Alf::Relvar
- Defined in:
- lib/alf-relvar/alf/relvar/read_only.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
(also: #to_relation)
readonly
Returns the value of attribute value.
#connection
Instance Method Summary
collapse
#affect, #each, #empty!, #empty?, #not_empty!, #safe, #to_relvar, #upsert
new
def_renderer_method, #to_a, #to_array
#!~, #&, #*, #+, #-, #=~, #allbut, def_operator_method, #tuple_extract
def_aggregator_method
#attr_list, coerce, #to_dot
#bind, #bound?, #connection!
Constructor Details
#initialize(value) ⇒ ReadOnly
Returns a new instance of ReadOnly.
6
7
8
|
# File 'lib/alf-relvar/alf/relvar/read_only.rb', line 6
def initialize(value)
@value = value
end
|
Instance Attribute Details
#value ⇒ Object
Also known as:
to_relation
Returns the value of attribute value.
9
10
11
|
# File 'lib/alf-relvar/alf/relvar/read_only.rb', line 9
def value
@value
end
|
Instance Method Details
#delete(predicate = Predicate.tautology) ⇒ Object
35
36
37
|
# File 'lib/alf-relvar/alf/relvar/read_only.rb', line 35
def delete(predicate = Predicate.tautology)
raise ReadOnlyError, "Unable to delete in read-only relation variables"
end
|
#heading ⇒ Object
17
18
19
|
# File 'lib/alf-relvar/alf/relvar/read_only.rb', line 17
def heading
value.heading
end
|
#insert(tuples) ⇒ Object
31
32
33
|
# File 'lib/alf-relvar/alf/relvar/read_only.rb', line 31
def insert(tuples)
raise ReadOnlyError, "Unable to insert in read-only relation variables"
end
|
#keys ⇒ Object
21
22
23
|
# File 'lib/alf-relvar/alf/relvar/read_only.rb', line 21
def keys
value.keys
end
|
#lock(mode = :exclusive) ⇒ Object
27
28
29
|
# File 'lib/alf-relvar/alf/relvar/read_only.rb', line 27
def lock(mode = :exclusive)
yield
end
|
#to_cog ⇒ Object
47
48
49
|
# File 'lib/alf-relvar/alf/relvar/read_only.rb', line 47
def to_cog
value.to_cog
end
|
#to_lispy ⇒ Object
51
52
53
|
# File 'lib/alf-relvar/alf/relvar/read_only.rb', line 51
def to_lispy
value.to_lispy
end
|
#to_s ⇒ Object
55
56
57
|
# File 'lib/alf-relvar/alf/relvar/read_only.rb', line 55
def to_s
"Relvar::ReadOnly(#{value.to_s})"
end
|
#type ⇒ Object
Static analysis & inference
13
14
15
|
# File 'lib/alf-relvar/alf/relvar/read_only.rb', line 13
def type
value.class
end
|
#update(updating, predicate) ⇒ Object
39
40
41
|
# File 'lib/alf-relvar/alf/relvar/read_only.rb', line 39
def update(updating, predicate)
raise ReadOnlyError, "Unable to update read-only relation variables"
end
|