class Vfwcash::Api

Attributes

cash[RW]
config[RW]

Public Class Methods

new(date=nil) click to toggle source
# File lib/vfwcash/api.rb, line 5
def initialize(date=nil)
  @date = Vfwcash.set_date(date)
  @config = Vfwcash.config
  require_relative './sqlite_base'
  Dir.glob(File.join(LibPath,'models/*')).each do |file|
    require file
  end
  @cash = Gcash.new(@config)
  unless @cash.dates.include?(@date)
    puts "No transactions exist for #{@date.beginning_of_month}"
  end
end

Public Instance Methods

audit() click to toggle source
# File lib/vfwcash/api.rb, line 42
def audit
  pdf = Audit.new(@date,@cash)
end
balance() click to toggle source
# File lib/vfwcash/api.rb, line 46
def balance
  pdf = Balance.new(@date,@cash)
end
between(from,to) click to toggle source
# File lib/vfwcash/api.rb, line 18
def between(from,to)
  pdf = Between.new(@date,@cash,from,to)
end
ledger() click to toggle source
# File lib/vfwcash/api.rb, line 26
def ledger
  pdf = Ledger.new(@date,@cash)
end
profit_loss(report) click to toggle source
# File lib/vfwcash/api.rb, line 22
def profit_loss(report)
  pdf = ProfitLoss.new(report)
end
register_pdf() click to toggle source
# File lib/vfwcash/api.rb, line 34
def register_pdf
  pdf = RegisterPdf.new(@date,@cash)
end
split() click to toggle source
# File lib/vfwcash/api.rb, line 38
def split
  pdf = SplitLedger.new(@date,@cash)
end
summary() click to toggle source
# File lib/vfwcash/api.rb, line 30
def summary
  pdf = Summary.new(@cash)
end