Module: Alf::Lang::Functional
- Included in:
- Optimizer::Restrict, Update::Inserter
- Defined in:
- lib/alf-lang/alf/lang/functional.rb
Class Method Summary collapse
Instance Method Summary collapse
- #allbut(operand, attributes) ⇒ Object
- #Heading(*args, &bl) ⇒ Object
- #Relation(*args, &bl) ⇒ Object
- #Tuple(*args, &bl) ⇒ Object
Class Method Details
.def_aggregator_method(name, clazz) ⇒ Object
6 7 8 9 10 |
# File 'lib/alf-lang/alf/lang/functional.rb', line 6 def def_aggregator_method(name, clazz) define_method(name) do |*args, &block| clazz.new(*args, &block) end end |
.def_operator_method(name, clazz) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/alf-lang/alf/lang/functional.rb', line 12 def def_operator_method(name, clazz) define_method(name) do |*args| operands, arguments = args[0...clazz.arity], args[clazz.arity..-1] _op_wrap clazz.new(operands.map{|op| _op_unwrap(op) }, *arguments) end end |
Instance Method Details
#allbut(operand, attributes) ⇒ Object
40 41 42 |
# File 'lib/alf-lang/alf/lang/functional.rb', line 40 def allbut(operand, attributes) project(operand, attributes, :allbut => true) end |
#Heading(*args, &bl) ⇒ Object
20 21 22 |
# File 'lib/alf-lang/alf/lang/functional.rb', line 20 def Heading(*args, &bl) Alf::Heading(*args, &bl) end |