lib/units_mixin.rb
# Use the wrapper object for Rationals as it's frozen in Ruby 2.5
# This is also done in NumericMixin
Use the wrapper object for Rationals as it's frozen in Ruby 2.5
This is also done in NumericMixin
Use the wrapper object for Rationals as it ' s frozen in Ruby 2 . 5 This is also done in NumericMixin
def apply_result_units(result, result_units)
	if result.respond_to?(:units=) && !result.is_a?(Rational)
	    result.units = result_units
	    result
	elsif result_units
	    Units::Numeric.new(result, result_units)
	else
	    result
	end
    end
def apply_result_units ( result , result_units ) if result . respond_to? ( :units= ) && ! result . is_a? ( Rational ) result . units = result_units result elsif result_units Units :: Numeric . new ( result , result_units ) else result end end
Use the wrapper object for Rationals as it's frozen in Ruby 2.5
This is also done in NumericMixin
Use the wrapper object for Rationals as it ' s frozen in Ruby 2 . 5 This is also done in NumericMixin
result
<not_specific>
result_units
<not_specific>