Class: Unit::Types::Date

Inherits:
Object
  • Object
show all
Defined in:
lib/unit-ruby/types/date.rb

Class Method Summary collapse

Class Method Details

.cast(value) ⇒ Object



6
7
8
9
10
# File 'lib/unit-ruby/types/date.rb', line 6

def self.cast(value)
  return nil if value.nil?

  ::Date.parse(value).strftime('%F')
end