Class: QueryFilter::Rules::SplitterRange

Inherits:
Scope
  • Object
show all
Defined in:
lib/query_filter/rules/splitter_range.rb

Defined Under Namespace

Classes: RangeParam

Constant Summary

Constants inherited from Scope

QueryFilter::Rules::Scope::VALIDATON_KEYS

Instance Attribute Summary

Attributes inherited from Scope

#keys

Instance Method Summary collapse

Methods inherited from Scope

#blank_validation?, #can_apply?, #endpoint, #initialize, #key

Constructor Details

This class inherits a constructor from QueryFilter::Rules::Scope

Instance Method Details

#nameObject



23
24
25
# File 'lib/query_filter/rules/splitter_range.rb', line 23

def name
  'splitter_range'.freeze
end

#normalize_params(values) ⇒ Object



32
33
34
# File 'lib/query_filter/rules/splitter_range.rb', line 32

def normalize_params(values)
  build_period_from_params(values)
end

#valid?(values) ⇒ Boolean

Returns:

  • (Boolean)


27
28
29
30
# File 'lib/query_filter/rules/splitter_range.rb', line 27

def valid?(values)
  period = build_period_from_params(values)
  !period.nil?
end