lib/danica/wrapper/constant.rb in danica-2.6.4 vs lib/danica/wrapper/constant.rb in danica-2.7.1
- old
+ new
@@ -1,20 +1,20 @@
module Danica
class Wrapper::Constant
include BaseOperations
include Common
- attr_reader :value, :latex, :gnu
+ attr_reader :value, :latex, :gnuplot
default_value :priority, 10
default_value :valued?, true
default_value :is_grouped?, false
default_value :constant?, true
def initialize(*args)
attrs = args.extract_options!
- attrs = args.as_hash(%i(value latex gnu)).merge(attrs)
+ attrs = args.as_hash(%i(value latex gnuplot)).merge(attrs)
attrs.each do |key, value|
self.send("#{key}=", value)
end
end
@@ -23,19 +23,19 @@
value.to_f
end
def ==(other)
return false unless other.class == self.class
- gnu == other.gnu && latex == other.latex && value == other.value
+ gnuplot == other.gnuplot && latex == other.latex && value == other.value
end
- def to_tex
+ def to_tex(**_)
latex.to_s
end
- def to_gnu
- gnu.to_s
+ def to_gnu(**_)
+ gnuplot.to_s
end
private
def value=(value)
@@ -44,11 +44,11 @@
def latex=(latex)
@latex = latex
end
- def gnu=(gnu)
- @gnu = gnu
+ def gnuplot=(gnuplot)
+ @gnuplot = gnuplot
end
end
E = Wrapper::Constant.new(Math::E, :e, 'exp(1)')
PI = Wrapper::Constant.new(Math::PI, '\pi', :pi)