Class: Alf::Relvar::Fake

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

Instance Attribute Summary collapse

Attributes included from Alf::Relvar

#expr

Instance Method Summary collapse

Methods included from Alf::Relvar

#affect, #each, #empty!, #empty?, #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, #keys, #resulting_type, #to_ascii_tree, #to_cog, #to_relation, #type_check

Constructor Details

#initialize(expr, heading) ⇒ Fake

Returns a new instance of Fake


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

def initialize(expr, heading)
  super(expr)
  @heading = Heading.coerce(heading)
end

Instance Attribute Details

#delete_predicateObject (readonly)

Returns the value of attribute delete_predicate


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

def delete_predicate
  @delete_predicate
end

#headingObject (readonly)

Returns the value of attribute heading


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

def heading
  @heading
end

#inserted_tuplesObject (readonly)

Returns the value of attribute inserted_tuples


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

def inserted_tuples
  @inserted_tuples
end

#update_predicateObject (readonly)

Returns the value of attribute update_predicate


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

def update_predicate
  @update_predicate
end

#updatingObject (readonly)

Returns the value of attribute updating


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

def updating
  @updating
end

Instance Method Details

#delete(predicate = Predicate.tautology) ⇒ Object


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

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

#insert(tuples) ⇒ Object


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

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

#to_lispyObject


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

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

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


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

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