Class: Danica::Wrapper::Negative
- Inherits:
-
Object
- Object
- Danica::Wrapper::Negative
- Includes:
- BaseOperations, VariablesHolder
- Defined in:
- lib/danica/wrapper/negative.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(value) ⇒ Negative
constructor
A new instance of Negative.
- #to(*args) ⇒ Object
- #to_f ⇒ Object
Methods included from VariablesHolder
Methods included from Common
#content, #formatted, #gnu, #tex, #to_gnu, #to_tex, #valued?
Methods included from BaseOperations
Constructor Details
#initialize(value) ⇒ Negative
Returns a new instance of Negative.
16 17 18 |
# File 'lib/danica/wrapper/negative.rb', line 16 def initialize(value) @value = wrap_value(value) end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
8 9 10 |
# File 'lib/danica/wrapper/negative.rb', line 8 def value @value end |
Instance Method Details
#==(other) ⇒ Object
28 29 30 31 32 |
# File 'lib/danica/wrapper/negative.rb', line 28 def ==(other) return false unless other.class == self.class value == other.value end |
#to(*args) ⇒ Object
24 25 26 |
# File 'lib/danica/wrapper/negative.rb', line 24 def to(*args) "-#{wrap_as_group(value).to(*args)}" end |
#to_f ⇒ Object
20 21 22 |
# File 'lib/danica/wrapper/negative.rb', line 20 def to_f -value.to_f end |