Class: Financial::FinancialDate
- Inherits:
-
Object
- Object
- Financial::FinancialDate
- Extended by:
- Forwardable
- Defined in:
- lib/financial/financial_date.rb
Instance Attribute Summary collapse
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#day ⇒ Object
readonly
Returns the value of attribute day.
-
#month ⇒ Object
readonly
Returns the value of attribute month.
-
#year ⇒ Object
readonly
Returns the value of attribute year.
Instance Method Summary collapse
-
#initialize(string_date) ⇒ FinancialDate
constructor
A new instance of FinancialDate.
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
#date ⇒ Object (readonly)
Returns the value of attribute date.
3 4 5 |
# File 'lib/financial/financial_date.rb', line 3 def date @date end |
#day ⇒ Object (readonly)
Returns the value of attribute day.
3 4 5 |
# File 'lib/financial/financial_date.rb', line 3 def day @day end |
#month ⇒ Object (readonly)
Returns the value of attribute month.
3 4 5 |
# File 'lib/financial/financial_date.rb', line 3 def month @month end |
#year ⇒ Object (readonly)
Returns the value of attribute year.
3 4 5 |
# File 'lib/financial/financial_date.rb', line 3 def year @year end |