Class: Camille::Types::DateTime
- Inherits:
-
Camille::Type
- Object
- BasicType
- Camille::Type
- Camille::Types::DateTime
- Includes:
- Camille::Types
- Defined in:
- lib/camille/generators/templates/date_time.rb
Instance Attribute Summary
Attributes inherited from Camille::Type
Attributes inherited from BasicType
Instance Method Summary collapse
- #check(value) ⇒ Object
-
#transform(value) ⇒ Object
transforms a DateTime into a String of ISO 8601 format.
Methods included from Camille::Types
Methods inherited from Camille::Type
alias_of, check, #check_params, check_params, inherited, #initialize, klass_name, #literal
Methods inherited from BasicType
&, #&, [], #[], #check_params, check_params, directly_instantiable?, inherited, #initialize, instance, |, #|
Constructor Details
This class inherits a constructor from Camille::Type
Instance Method Details
#check(value) ⇒ Object
13 14 15 16 |
# File 'lib/camille/generators/templates/date_time.rb', line 13 def check value normalized = transform value super normalized end |
#transform(value) ⇒ Object
transforms a DateTime into a String of ISO 8601 format
9 10 11 |
# File 'lib/camille/generators/templates/date_time.rb', line 9 def transform value value.as_json end |