Class: Vfwcash::Api
- Inherits:
-
Object
- Object
- Vfwcash::Api
- Defined in:
- lib/vfwcash/api.rb
Instance Attribute Summary collapse
-
#cash ⇒ Object
Returns the value of attribute cash.
-
#config ⇒ Object
Returns the value of attribute config.
Instance Method Summary collapse
- #audit ⇒ Object
- #balance ⇒ Object
- #between(from, to) ⇒ Object
-
#initialize(date = nil) ⇒ Api
constructor
A new instance of Api.
- #ledger ⇒ Object
- #profit_loss(report) ⇒ Object
- #register_pdf ⇒ Object
- #split ⇒ Object
- #summary ⇒ Object
Constructor Details
#initialize(date = nil) ⇒ Api
Returns a new instance of Api.
5 6 7 8 9 10 11 12 13 14 15 16 |
# 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 |
Instance Attribute Details
#cash ⇒ Object
Returns the value of attribute cash.
4 5 6 |
# File 'lib/vfwcash/api.rb', line 4 def cash @cash end |
#config ⇒ Object
Returns the value of attribute config.
4 5 6 |
# File 'lib/vfwcash/api.rb', line 4 def config @config end |
Instance Method Details
#audit ⇒ Object
42 43 44 |
# File 'lib/vfwcash/api.rb', line 42 def audit pdf = Audit.new(@date,@cash) end |
#balance ⇒ Object
46 47 48 |
# File 'lib/vfwcash/api.rb', line 46 def balance pdf = Balance.new(@date,@cash) end |
#between(from, to) ⇒ Object
18 19 20 |
# File 'lib/vfwcash/api.rb', line 18 def between(from,to) pdf = Between.new(@date,@cash,from,to) end |
#ledger ⇒ Object
26 27 28 |
# File 'lib/vfwcash/api.rb', line 26 def ledger pdf = Ledger.new(@date,@cash) end |
#profit_loss(report) ⇒ Object
22 23 24 |
# File 'lib/vfwcash/api.rb', line 22 def profit_loss(report) pdf = ProfitLoss.new(report) end |
#register_pdf ⇒ Object
34 35 36 |
# File 'lib/vfwcash/api.rb', line 34 def register_pdf pdf = RegisterPdf.new(@date,@cash) end |
#split ⇒ Object
38 39 40 |
# File 'lib/vfwcash/api.rb', line 38 def split pdf = SplitLedger.new(@date,@cash) end |