Class: Dtn::Lookups::News::Base::DateRangeValidator

Inherits:
Object
  • Object
show all
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

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

#callObject



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