Class: Compendium::DateParam
- Defined in:
- lib/compendium/param_types.rb
Instance Method Summary collapse
- #date? ⇒ Boolean
-
#initialize(obj) ⇒ DateParam
constructor
A new instance of DateParam.
Methods inherited from Param
#==, #boolean?, #dropdown?, #nil?, #radio?
Constructor Details
#initialize(obj) ⇒ DateParam
Returns a new instance of DateParam.
65 66 67 68 69 70 71 72 73 |
# File 'lib/compendium/param_types.rb', line 65 def initialize(obj, *) if obj.respond_to?(:to_date) obj = obj.to_date else obj = Date.parse(obj) rescue nil end super obj end |
Instance Method Details
#date? ⇒ Boolean
75 76 77 |
# File 'lib/compendium/param_types.rb', line 75 def date? true end |