Class: Alf::Relvar::Fake

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

Instance Attribute Summary collapse

Attributes included from Support::Bindable

#connection

Instance Method Summary collapse

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

new

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

def_aggregator_method

Methods included from Algebra::Operand

#attr_list, coerce, #keys, #to_cog, #to_dot, #to_relation

Methods included from Support::Bindable

#bind, #bound?, #connection!

Constructor Details

#initialize(heading) ⇒ Fake

Returns a new instance of Fake.



6
7
8
# File 'lib/alf-relvar/alf/relvar/fake.rb', line 6

def initialize(heading)
  @heading = Heading.coerce(heading)
end

Instance Attribute Details

#delete_predicateObject (readonly)

Returns the value of attribute delete_predicate.



19
20
21
# File 'lib/alf-relvar/alf/relvar/fake.rb', line 19

def delete_predicate
  @delete_predicate
end

#headingObject (readonly)

Returns the value of attribute heading.



9
10
11
# File 'lib/alf-relvar/alf/relvar/fake.rb', line 9

def heading
  @heading
end

#inserted_tuplesObject (readonly)

Returns the value of attribute inserted_tuples.



14
15
16
# File 'lib/alf-relvar/alf/relvar/fake.rb', line 14

def inserted_tuples
  @inserted_tuples
end

#update_predicateObject (readonly)

Returns the value of attribute update_predicate.



26
27
28
# File 'lib/alf-relvar/alf/relvar/fake.rb', line 26

def update_predicate
  @update_predicate
end

#updatingObject (readonly)

Returns the value of attribute updating.



25
26
27
# File 'lib/alf-relvar/alf/relvar/fake.rb', line 25

def updating
  @updating
end

Instance Method Details

#delete(predicate = Predicate.tautology) ⇒ Object



16
17
18
# File 'lib/alf-relvar/alf/relvar/fake.rb', line 16

def delete(predicate = Predicate.tautology)
  @delete_predicate = predicate
end

#insert(tuples) ⇒ Object



11
12
13
# File 'lib/alf-relvar/alf/relvar/fake.rb', line 11

def insert(tuples)
  @inserted_tuples = tuples.to_a
end

#to_lispyObject



28
29
30
# File 'lib/alf-relvar/alf/relvar/fake.rb', line 28

def to_lispy
  "Relvar::Fake(#{heading.to_lispy})"
end

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



21
22
23
24
# File 'lib/alf-relvar/alf/relvar/fake.rb', line 21

def update(updating, predicate = Predicate.tautology)
  @updating = updating.to_hash
  @update_predicate = predicate
end