Class: Danica::Wrapper::Constant
- Inherits:
-
Object
- Object
- Danica::Wrapper::Constant
- Includes:
- BaseOperations, Common
- Defined in:
- lib/danica/wrapper/constant.rb
Instance Attribute Summary collapse
-
#gnuplot ⇒ Object
readonly
Returns the value of attribute gnuplot.
-
#latex ⇒ Object
readonly
Returns the value of attribute latex.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(*args) ⇒ Constant
constructor
A new instance of Constant.
- #to_f ⇒ Object
- #to_gnu(**_options) ⇒ Object
- #to_tex(**_options) ⇒ Object
Methods included from Common
#content, #formatted, #gnu, #tex, #to, #valued?
Methods included from BaseOperations
Constructor Details
#initialize(*args) ⇒ Constant
Returns a new instance of Constant.
15 16 17 18 19 20 21 22 |
# File 'lib/danica/wrapper/constant.rb', line 15 def initialize(*args) attrs = args. attrs = args.as_hash(%i[value latex gnuplot]).merge(attrs) attrs.each do |key, value| send("#{key}=", value) end end |
Instance Attribute Details
#gnuplot ⇒ Object
Returns the value of attribute gnuplot.
8 9 10 |
# File 'lib/danica/wrapper/constant.rb', line 8 def gnuplot @gnuplot end |
#latex ⇒ Object
Returns the value of attribute latex.
8 9 10 |
# File 'lib/danica/wrapper/constant.rb', line 8 def latex @latex end |
#value ⇒ Object
Returns the value of attribute value.
8 9 10 |
# File 'lib/danica/wrapper/constant.rb', line 8 def value @value end |
Instance Method Details
#==(other) ⇒ Object
28 29 30 31 32 |
# File 'lib/danica/wrapper/constant.rb', line 28 def ==(other) return false unless other.class == self.class gnuplot == other.gnuplot && latex == other.latex && value == other.value end |
#to_f ⇒ Object
24 25 26 |
# File 'lib/danica/wrapper/constant.rb', line 24 def to_f value.to_f end |
#to_gnu(**_options) ⇒ Object
38 39 40 |
# File 'lib/danica/wrapper/constant.rb', line 38 def to_gnu(**) gnuplot.to_s end |
#to_tex(**_options) ⇒ Object
34 35 36 |
# File 'lib/danica/wrapper/constant.rb', line 34 def to_tex(**) latex.to_s end |