lib/hubrise_money/money.rb
# Division with options:
#  - :round_up -> makes split cent round up to upper cent instead of lower by default
Division with options:
:round_up -> makes split cent round up to upper cent instead of lower by default
Division with options : : round_up - > makes split cent round up to upper cent instead of lower by default
def div(other, options = {})
    unless other.is_a?(Numeric)
      raise(Error, "Was expecting Numeric as divider, got #{other.inspect} (#{other.class})")
    end
    _cents = (cents / other).to_i
    _cents += 1 if options[:round_up] && (_cents * other).to_i < cents
    self.class.new(_cents, currency)
  end
def div ( other , options = { } ) unless other . is_a? ( Numeric ) raise ( Error , "Was expecting Numeric as divider, got #{other.inspect} (#{other.class})" ) end _cents = ( cents / other ) . to_i _cents += 1 if options [ :round_up ] && ( _cents * other ) . to_i < cents self . class . new ( _cents , currency ) end
Division with options:
 :round_up -> makes split cent round up to upper cent instead of lower by default
Division with options : : round_up - > makes split cent round up to upper cent instead of lower by default
other
<not_specific>
options
<not_specific>