Class: Dtn::Lookups::News::Base::DateRangeValidator
- Inherits:
-
Object
- Object
- Dtn::Lookups::News::Base::DateRangeValidator
- Includes:
- Concerns::Validation
- Defined in:
- lib/dtn/lookups/news/base.rb
Overview
Date range validator. Consume Date, Range or String as a values (or any combination of them as the args, Array including) Returns Dtn valid String
Constant Summary
Constants included from Concerns::Validation
Concerns::Validation::DATE_FORMAT, Concerns::Validation::DATE_TIME_FORMAT, Concerns::Validation::DEFAULT_INTERVAL_TYPE, Concerns::Validation::MAX_INT16
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(*values) ⇒ DateRangeValidator
constructor
A new instance of DateRangeValidator.
Constructor Details
#initialize(*values) ⇒ DateRangeValidator
Returns a new instance of DateRangeValidator.
34 35 36 |
# File 'lib/dtn/lookups/news/base.rb', line 34 def initialize(*values) @values = values.flatten end |
Instance Method Details
#call ⇒ Object
38 39 40 41 42 |
# File 'lib/dtn/lookups/news/base.rb', line 38 def call return "" if empty_values? check_each_value.join(":") end |