Class: Danica::Variable
- Inherits:
-
Object
- Object
- Danica::Variable
- Includes:
- ActiveModel::Model
- Defined in:
- lib/danica/variable.rb
Instance Attribute Summary collapse
-
#gnu ⇒ Object
Returns the value of attribute gnu.
-
#latex ⇒ Object
Returns the value of attribute latex.
-
#name ⇒ Object
Returns the value of attribute name.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
Instance Attribute Details
#gnu ⇒ Object
Returns the value of attribute gnu.
4 5 6 |
# File 'lib/danica/variable.rb', line 4 def gnu @gnu end |
#latex ⇒ Object
Returns the value of attribute latex.
4 5 6 |
# File 'lib/danica/variable.rb', line 4 def latex @latex end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/danica/variable.rb', line 4 def name @name end |
#value ⇒ Object
Returns the value of attribute value.
4 5 6 |
# File 'lib/danica/variable.rb', line 4 def value @value end |
Instance Method Details
#==(other) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/danica/variable.rb', line 10 def ==(other) return false unless other.class == Variable return other.value == value && other.name == name && other.latex == latex && other.gnu == gnu end |
#to_f ⇒ Object
6 7 8 |
# File 'lib/danica/variable.rb', line 6 def to_f value.nil? ? raise(Exception::NotDefined) : value.to_f end |
#to_gnu ⇒ Object
23 24 25 26 |
# File 'lib/danica/variable.rb', line 23 def to_gnu return value.to_gnu if value (gnu || name).to_s end |
#to_tex ⇒ Object
18 19 20 21 |
# File 'lib/danica/variable.rb', line 18 def to_tex return value.to_tex if value (latex || name).to_s end |
#valued? ⇒ Boolean
28 29 30 |
# File 'lib/danica/variable.rb', line 28 def valued? value.present? end |