Class: Compel::Builder::Time

Inherits:
Schema
  • Object
show all
Defined in:
lib/compel/builder/time.rb

Instance Attribute Summary

Attributes inherited from Schema

#options, #type

Instance Method Summary collapse

Methods inherited from Schema

#default_value, #required?, #validate

Methods included from Common

#default, #length, #required

Constructor Details

#initializeTime

Returns a new instance of Time.



6
7
8
# File 'lib/compel/builder/time.rb', line 6

def initialize
  super(Coercion::Time)
end

Instance Method Details

#format(value) ⇒ Object



10
11
12
13
# File 'lib/compel/builder/time.rb', line 10

def format(value)
  options[:format] = value
  self
end

#iso8601Object



15
16
17
18
# File 'lib/compel/builder/time.rb', line 15

def iso8601
  options[:format] = '%FT%T'
  self
end