Class: BlankDate

Inherits:
Date
  • Object
show all
Defined in:
lib/blank_date.rb

Overview

As our form objects convert to the correct type on input, rather than use the typical mess of fetching values before validation that active record does, we will take the approach of having a blank date which is simply an instance of Date whose blank? method returns true

Instance Method Summary collapse

Instance Method Details

#blank?Boolean

Returns:

  • (Boolean)

6
7
8
# File 'lib/blank_date.rb', line 6

def blank?
  true
end

#dayObject


10
11
12
# File 'lib/blank_date.rb', line 10

def day
  nil
end

#monthObject


14
15
16
# File 'lib/blank_date.rb', line 14

def month
  nil
end

#yearObject


18
19
20
# File 'lib/blank_date.rb', line 18

def year
  nil
end