lib/danica/common.rb in danica-2.6.4 vs lib/danica/common.rb in danica-2.7.1
- old
+ new
@@ -16,34 +16,43 @@
end
end
default_values :constant?, :signaled?, :container?, :variable?,
:variable_holder?, false
+ default_value :priority, 1
end
def to_f
raise Exception::NotImplemented
end
- def to_tex
- to(:tex)
+ def to_tex(**options)
+ to(:tex, options)
end
- def to_gnu
- to(:gnu)
+ def to_gnu(**options)
+ to(:gnu, options)
end
- def to(format)
+ def to(format, **options)
case format.to_sym
when :tex
- to_tex
+ to_tex(options)
when :gnu
- to_gnu
+ to_gnu(options)
when :f
to_f
else
- raise Exception::FormatNotFound.new
+ raise Exception::FormattedNotFound.new
end
+ end
+
+ def tex(**options)
+ Formatted.new(self, :tex, options)
+ end
+
+ def gnu(**options)
+ Formatted.new(self, :gnu, options)
end
def valued?
to_f.present?
rescue Exception::NotDefined