Method: Weight#-
- Defined in:
- lib/weight.rb
#-(other) ⇒ Weight
Substract operation
80 81 82 83 |
# File 'lib/weight.rb', line 80 def -(other) raise TypeError, 'You can only substract weights' unless other.is_a?(Weight) self.class.new(value - other_value(other), unit) end |