Class: GlueGun::Types::DateType
- Inherits:
-
ActiveModel::Type::Value
- Object
- ActiveModel::Type::Value
- GlueGun::Types::DateType
- Defined in:
- lib/glue_gun/types/date_type.rb
Instance Method Summary collapse
Instance Method Details
#cast(value) ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/glue_gun/types/date_type.rb', line 4 def cast(value) case value when String parse_string(value).to_date when Date, DateTime value.to_date end end |
#serialize(value) ⇒ Object
13 14 15 |
# File 'lib/glue_gun/types/date_type.rb', line 13 def serialize(value) value.to_s end |