lib/pione/model/feature-expr.rb in pione-0.1.4 vs lib/pione/model/feature-expr.rb in pione-0.2.0
- old
+ new
@@ -83,15 +83,10 @@
end
# SpecialFeature is a class for empty feature and boundless feature.
class SpecialFeature < Expr
# @api private
- def task_id_string
- "Feature::SpecialFeature<#{symbol}>"
- end
-
- # @api private
def textize
symbol
end
# @api private
@@ -191,15 +186,10 @@
@symbol = symbol
super()
end
# @api private
- def task_id_string
- "Feature::UnaryOperator<#{self.operator},#{@symbol}>"
- end
-
- # @api private
def textize
"%s%s" % [self.operator, @symbol]
end
# @api private
@@ -360,17 +350,10 @@
return false unless @elements.size == 1
return @elements.first.empty?
end
# @api private
- def task_id_string
- "Feature::Connective<#{self.class.name},[%s]>" % [
- @elements.map{|elt| elt.task_id_string}.join(",")
- ]
- end
-
- # @api private
def textize
"#{self.class.name}(%s)" % @elements.map{|elt| elt.textize}.join(",")
end
# @api private
@@ -871,22 +854,22 @@
# set_element_class Feature::Expr
# end
end
TypeFeature.instance_eval do
- define_pione_method("==", [TypeFeature], TypeBoolean) do |rec, other|
+ define_pione_method("==", [TypeFeature], TypeBoolean) do |vtable, rec, other|
PioneBoolean.new(rec == other).to_seq
end
- define_pione_method("!=", [TypeFeature], TypeBoolean) do |rec, other|
- PioneBoolean.not(rec.call_pione_method("==", other)).to_seq
+ define_pione_method("!=", [TypeFeature], TypeBoolean) do |vtable, rec, other|
+ PioneBoolean.not(rec.call_pione_method(vtable, "==", other)).to_seq
end
- define_pione_method("as_string", [], TypeString) do |rec|
+ define_pione_method("as_string", [], TypeString) do |vtable, rec|
PioneString.new(rec.as_string).to_seq
end
- define_pione_method("str", [], TypeString) do |rec|
- rec.call_pione_method("as_string")
+ define_pione_method("str", [], TypeString) do |vtable, rec|
+ rec.call_pione_method(vtable, "as_string")
end
end
end