Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/cashflow/patches.rb
Instance Method Summary collapse
-
#to_date ⇒ Object
Assumes date represented as YYYY-MM-DD.
Instance Method Details
#to_date ⇒ Object
Assumes date represented as YYYY-MM-DD.
3 4 5 6 |
# File 'lib/cashflow/patches.rb', line 3 def to_date year, month, day = self.split("-").map(&:to_i) Date.strptime("{ #{year}, #{month}, #{day} }", "{ %Y, %m, %d }") end |