Class: Alf::Update::Updater

Inherits:
Algebra::Compiler show all
Defined in:
lib/alf/update/updater.rb

Instance Method Summary collapse

Methods inherited from Algebra::Compiler

#apply, #call, #on_missing

Methods included from Algebra::Visitor

#copy_and_apply

Instance Method Details

#not_supported(expr, *args) ⇒ Object Also known as: on_autonum, on_clip, on_coerce, on_compact, on_defaults, on_generator, on_sort, on_extend, on_group, on_intersect, on_join, on_matching, on_minus, not_matching, on_project, on_quota, on_rank, on_rename, on_summarize, on_ungroup, on_union, on_unwrap, on_wrap

overridings

Raises:


7
8
9
# File 'lib/alf/update/updater.rb', line 7

def not_supported(expr, *args)
  raise NotSupportedError, "Unable to update through `#{expr}`"
end

#on_leaf_operand(expr, updating, predicate) ⇒ Object

leaf Operand, recursion end :-)


13
14
15
# File 'lib/alf/update/updater.rb', line 13

def on_leaf_operand(expr, updating, predicate)
  expr.to_relvar.update(updating, predicate)
end

#on_restrict(expr, updating, predicate) ⇒ Object


41
42
43
# File 'lib/alf/update/updater.rb', line 41

def on_restrict(expr, updating, predicate)
  apply(expr.operand, updating, expr.predicate & predicate)
end