lib/bmg/operator/constants.rb in bmg-0.5.0 vs lib/bmg/operator/constants.rb in bmg-0.6.0
- old
+ new
@@ -6,22 +6,21 @@
# Extends operand's tuples with attributes given at construction.
# This is a special case of an extension, where the values are
# statically known.
#
class Constants
- include Operator
+ include Operator::Unary
def initialize(type, operand, constants)
@type = type
@operand = operand
@constants = constants
end
- attr_reader :type
protected
- attr_reader :operand, :constants
+ attr_reader :constants
public
def each
@operand.each do |tuple|
@@ -90,9 +89,15 @@
result = result.restrict(top_p)
result
end
rescue Predicate::NotSupportedError
super
+ end
+
+ protected ### inspect
+
+ def args
+ [ constants ]
end
private
def extend_it(tuple)