Parent

Reckon::MoneyColumn

Public Class Methods

new( arr = [], options = {} ) click to toggle source
# File lib/reckon/money.rb, line 65
def initialize( arr = [], options = {} )
  arr.each { |str| self.push( Money.from_s( str, options ) ) }
end

Public Instance Methods

merge!( other_column ) click to toggle source
# File lib/reckon/money.rb, line 76
def merge!( other_column )
  invert = false
  invert = true if self.positive? && other_column.positive?
  self.each_with_index do |mon, i|
    other = other_column[i]
    if mon && !other
      if invert
        self[i]= -mon
      end
    elsif !mon && other
      self[i] = other
    else
      return nil
    end
  end
  self
end
positive?() click to toggle source
# File lib/reckon/money.rb, line 69
def positive?
  self.each do |money|
    return false if money < 0 if money
  end
  true
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.