lib/unit_measurements/math.rb in unit_measurements-2.6.0 vs lib/unit_measurements/math.rb in unit_measurements-2.6.1
- old
+ new
@@ -6,11 +6,11 @@
module Math
# Rounds quantity of the measurement. If `ndigits` is not specified,
# quantity is rounded to `Integer`.
#
# @example
- # UnitMeasurements::Weight.new(1, :g).convert_to(:st).round(4)
+ # UnitMeasurements::Weight.new(1, "g").convert_to("st").round(4)
# => 0.0002 st
#
# @param [Integer] ndigits
#
# @return [Measurement]
@@ -19,32 +19,32 @@
end
# Returns absolute value of the measurement quantity.
#
# @example
- # UnitMeasurements::Length.new(-17.625, :m).abs
+ # UnitMeasurements::Length.new(-17.625, "m").abs
# => 17.625 m
#
# @return [Measurement]
def abs
self.class.new(quantity.abs, unit)
end
# Rounds quantity of the measurement to next lower integer.
#
# @example
- # UnitMeasurements::Length.new(17.625, :m).floor
+ # UnitMeasurements::Length.new(17.625, "m").floor
# => 17 m
#
# @return [Measurement]
def floor(*args)
self.class.new(quantity.floor(*args), unit)
end
# Rounds quantity of the measurement to next higher integer.
#
# @example
- # UnitMeasurements::Length.new(17.625, :m).ceil
+ # UnitMeasurements::Length.new(17.625, "m").ceil
# => 18 m
#
# @return [Measurement]
def ceil(*args)
self.class.new(quantity.ceil(*args), unit)