Class: Kharon::Processors::DateProcessor
- Inherits:
-
Kharon::Processor
- Object
- Kharon::Processor
- Kharon::Processors::DateProcessor
- Defined in:
- lib/kharon/processors/date_processor.rb
Overview
Processor to validate dates. It only has the default options.
Instance Attribute Summary
Attributes inherited from Kharon::Processor
Instance Method Summary (collapse)
-
- (Object) process(key, options = {})
Checks if the given key is a datetime or not.
Methods inherited from Kharon::Processor
Constructor Details
This class inherits a constructor from Kharon::Processor
Instance Method Details
- (Object) process(key, options = {})
Checks if the given key is a datetime or not.
15 16 17 18 |
# File 'lib/kharon/processors/date_processor.rb', line 15 def process(key, = {}) before_all(key, ) begin; store(key, ->(item){Date.parse(item.to_s)}, ); rescue; raise_type_error(key, "Date"); end end |