Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/cashflow/patches.rb

Instance Method Summary collapse

Instance Method Details

#to_dateObject

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