Class: Date
Overview
Cast a date to an id.
Instance Method Summary collapse
-
#to_date_id ⇒ Object
Cast me to a date id.
-
#to_date_ids ⇒ Object
Cast me to a list of date ids.
Instance Method Details
#to_date_id ⇒ Object
Cast me to a date id.
Date.today.to_date_id
#=> "2000-12-31"
12 13 14 |
# File 'lib/sixarm_ruby_to_id/date.rb', line 12 def to_date_id self.to_time.strftime("%Y-%m-%d") end |
#to_date_ids ⇒ Object
Cast me to a list of date ids.
Date.today.to_date_id
#=> "2000-12-31"
21 22 23 |
# File 'lib/sixarm_ruby_to_id/date.rb', line 21 def to_date_ids [self.to_date_id] end |