Class: Financial::FinancialDate

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/financial/financial_date.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(string_date) ⇒ FinancialDate

Returns a new instance of FinancialDate.



10
11
12
13
14
15
16
# File 'lib/financial/financial_date.rb', line 10

def initialize(string_date)
  if string_date
    @date = Date.strptime(string_date, Financial.locale.date_format)
  else
    @date = Date.today
  end
end

Instance Attribute Details

#dateObject (readonly)

Returns the value of attribute date.



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

def date
  @date
end

#dayObject (readonly)

Returns the value of attribute day.



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

def day
  @day
end

#monthObject (readonly)

Returns the value of attribute month.



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

def month
  @month
end

#yearObject (readonly)

Returns the value of attribute year.



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

def year
  @year
end