Class: DoubleEntry::BalanceCalculator::RelationBuilder Private

Inherits:
Object
  • Object
show all
Defined in:
lib/double_entry/balance_calculator.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ RelationBuilder

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of RelationBuilder.



90
91
92
# File 'lib/double_entry/balance_calculator.rb', line 90

def initialize(options)
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



87
88
89
# File 'lib/double_entry/balance_calculator.rb', line 87

def options
  @options
end

Instance Method Details

#buildObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



94
95
96
97
98
99
100
101
# File 'lib/double_entry/balance_calculator.rb', line 94

def build
  lines = Line.where(:account => )
  lines = lines.where('created_at <= ?', at) if at?
  lines = lines.where(:created_at => from..to) if between?
  lines = lines.where(:code => codes) if code?
  lines = lines.where(:scope => scope) if scope?
  lines
end