Module: ActiveModel::Form::DateAttribute

Defined in:
lib/active_model/form/attributes.rb

Class Method Summary collapse

Class Method Details

.number?Boolean

Returns:

  • (Boolean)

102
103
104
# File 'lib/active_model/form/attributes.rb', line 102

def self.number?
  false
end

.parse(v) ⇒ Object


90
91
92
93
94
95
96
# File 'lib/active_model/form/attributes.rb', line 90

def self.parse(v)
  if v.is_a?(String)
    Date.parse(v)
  else
    nil
  end
end

.typeObject


98
99
100
# File 'lib/active_model/form/attributes.rb', line 98

def self.type
  :timestamp
end