Class: Compel::Builder::DateTime
- Includes:
- CommonValue
- Defined in:
- lib/compel/builder/datetime.rb
Instance Attribute Summary
Attributes inherited from Schema
Instance Method Summary collapse
- #format(value, options = {}) ⇒ Object
-
#initialize ⇒ DateTime
constructor
A new instance of DateTime.
- #iso8601(options = {}) ⇒ Object
Methods included from CommonValue
#coerce_value!, #coerce_values_ary!, #in, #max, #min, #raise_array_error, #raise_array_values_error, #raise_value_error, #range
Methods inherited from Schema
#build_option, #default_options, #default_value, human_name, #required?, #validate
Methods included from Common
#coerce_if_proc, #default, #if, #is, #length, #max_length, #min_length, #required
Constructor Details
Instance Method Details
#format(value, options = {}) ⇒ Object
12 13 14 |
# File 'lib/compel/builder/datetime.rb', line 12 def format(value, = {}) build_option :format, value, end |
#iso8601(options = {}) ⇒ Object
16 17 18 |
# File 'lib/compel/builder/datetime.rb', line 16 def iso8601( = {}) build_option :format, '%FT%T', end |