Class: Date
- Inherits:
-
Object
- Object
- Date
- Defined in:
- lib/isomorfeus/ferret/stdlib_patches.rb
Instance Method Summary collapse
-
#to_s_lex(precision = :day) ⇒ Object
Convert the Date to a lexicographically sortable string with the required precision.
Instance Method Details
#to_s_lex(precision = :day) ⇒ Object
Convert the Date to a lexicographically sortable string with the required precision. The format used is %Y%m%d
- precision
the precision required in the string version of the date. The options are :year, :month and :day
- return
a lexicographically sortable string representing the date
60 61 62 |
# File 'lib/isomorfeus/ferret/stdlib_patches.rb', line 60 def to_s_lex(precision = :day) self.strftime(Time::LEX_FORMAT[precision]) end |