Class: Danica::Constant
- Inherits:
-
Object
- Object
- Danica::Constant
- Defined in:
- lib/danica/constant.rb
Instance Attribute Summary collapse
-
#gnu ⇒ Object
readonly
Returns the value of attribute gnu.
-
#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(value, latex, gnu) ⇒ Constant
constructor
A new instance of Constant.
- #to_f ⇒ Object
- #to_gnu ⇒ Object
- #to_tex ⇒ Object
- #valued? ⇒ Boolean
Constructor Details
#initialize(value, latex, gnu) ⇒ Constant
Returns a new instance of Constant.
5 6 7 8 9 |
# File 'lib/danica/constant.rb', line 5 def initialize(value, latex, gnu) @value = value @latex = latex @gnu = gnu end |
Instance Attribute Details
#gnu ⇒ Object (readonly)
Returns the value of attribute gnu.
3 4 5 |
# File 'lib/danica/constant.rb', line 3 def gnu @gnu end |
#latex ⇒ Object (readonly)
Returns the value of attribute latex.
3 4 5 |
# File 'lib/danica/constant.rb', line 3 def latex @latex end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
3 4 5 |
# File 'lib/danica/constant.rb', line 3 def value @value end |
Instance Method Details
#==(other) ⇒ Object
15 16 17 |
# File 'lib/danica/constant.rb', line 15 def ==(other) return false unless other.class == self.class end |
#to_f ⇒ Object
11 12 13 |
# File 'lib/danica/constant.rb', line 11 def to_f value.to_f end |
#to_gnu ⇒ Object
23 24 25 |
# File 'lib/danica/constant.rb', line 23 def to_gnu gnu.to_s end |
#to_tex ⇒ Object
19 20 21 |
# File 'lib/danica/constant.rb', line 19 def to_tex latex.to_s end |
#valued? ⇒ Boolean
27 28 29 |
# File 'lib/danica/constant.rb', line 27 def valued? true end |