Class: Financial::Balance

Inherits:
Object
  • Object
show all
Defined in:
lib/financial/balance.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(balance_value, balance_date) ⇒ Balance

Returns a new instance of Balance.



5
6
7
8
9
# File 'lib/financial/balance.rb', line 5

def initialize(balance_value, balance_date)
  @name = Financial.locale.balance_name
  @value = balance_value
  @date = balance_date.is_a?(Date) ? balance_date : Financial::FinancialDate.new(balance_date).date
end

Instance Attribute Details

#dateObject

Returns the value of attribute date.



3
4
5
# File 'lib/financial/balance.rb', line 3

def date
  @date
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/financial/balance.rb', line 3

def name
  @name
end

#valueObject

Returns the value of attribute value.



3
4
5
# File 'lib/financial/balance.rb', line 3

def value
  @value
end