Class: CukeSlicer::FilterSet

Inherits:
Object
  • Object
show all
Includes:
Helpers
Defined in:
lib/cuke_slicer/filters/filter_set.rb

Overview

private

Instance Method Summary collapse

Methods included from Helpers

#path?, #str_regex?, #str_regex_arr?, #tag?

Constructor Details

#initialize(filter_type, filter_value) ⇒ FilterSet

Returns a new instance of FilterSet.



15
16
17
18
# File 'lib/cuke_slicer/filters/filter_set.rb', line 15

def initialize(filter_type, filter_value)
  self.filter_type = filter_type
  self.filter_value = filter_value
end

Instance Method Details

#validateObject

private



21
22
23
24
25
26
27
28
29
# File 'lib/cuke_slicer/filters/filter_set.rb', line 21

def validate
  block_unknown
  block_invalid

  return unless filter_value.is_a?(Array)

  TagCollection.new(filter_value).validate if tag?(filter_type)
  PathCollection.new(filter_value).validate if path?(filter_type)
end