lib/danica/wrapper/variable.rb in danica-2.6.4 vs lib/danica/wrapper/variable.rb in danica-2.7.1

- old
+ new

@@ -1,19 +1,19 @@ module Danica class Wrapper::Variable include BaseOperations include Common - attr_accessor :value, :name, :latex, :gnu + attr_accessor :value, :name, :latex, :gnuplot default_value :priority, 10 default_value :is_grouped?, false default_value :variable?, true def initialize(*args) attrs = args.extract_options! - attrs = args.as_hash(%i(name value latex gnu)).merge(attrs) + attrs = args.as_hash(%i(name value latex gnuplot)).merge(attrs) attrs.each do |key, value| self.public_send("#{key}=", value) end end @@ -25,20 +25,20 @@ def ==(other) return false unless other.class == self.class return other.value == value && other.name == name && other.latex == latex && - other.gnu == gnu + other.gnuplot == gnuplot end - def to_tex - return value.to_tex if value + def to_tex(**options) + return value.to_tex(options) if value (latex || name).to_s end - def to_gnu - return value.to_gnu if value - (gnu || name).to_s + def to_gnu(**options) + return value.to_gnu(options) if value + (gnuplot || name).to_s end def value=(value) @value = value.is_a?(Numeric) ? number(value) : value end