Class: Virtus::Coercion::Date

Inherits:
Object show all
Extended by:
TimeCoercions
Defined in:
lib/virtus/coercion/date.rb

Overview

Coerce Date values

Constant Summary

Constants inherited from Object

Object::COERCION_METHOD_REGEXP

Constants included from TypeLookup

TypeLookup::EXTRA_CONST_ARGS, TypeLookup::TYPE_FORMAT

Class Method Summary collapse

Methods included from TimeCoercions

to_date, to_datetime, to_string, to_time

Methods inherited from Object

method_missing

Methods inherited from Virtus::Coercion

[]

Methods included from DescendantsTracker

#add_descendant, #descendants

Methods included from TypeLookup

#determine_type, #primitive

Methods included from Options

#accept_options, #accepted_options, #options

Class Method Details

.to_date(value) ⇒ Date

Passthrough the value

Examples:

Virtus::Coercion::DateTime.to_date(date)  # => Date object

Parameters:

Returns:



20
21
22
# File 'lib/virtus/coercion/date.rb', line 20

def self.to_date(value)
  value
end