Class: CukeSlicer::NestedTagCollection

Inherits:
Object
  • Object
show all
Includes:
Helpers
Defined in:
lib/cuke_slicer/collections/nested_tag_collection.rb

Overview

private

Instance Method Summary collapse

Methods included from Helpers

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

Constructor Details

#initialize(collection) ⇒ NestedTagCollection

Returns a new instance of NestedTagCollection.



13
14
15
# File 'lib/cuke_slicer/collections/nested_tag_collection.rb', line 13

def initialize(collection)
  self.nested_collection = collection
end

Instance Method Details

#validateObject

private



18
19
20
21
22
23
# File 'lib/cuke_slicer/collections/nested_tag_collection.rb', line 18

def validate
  nested_collection.each do |element|
    raise(ArgumentError, 'Tag filters cannot be nested more than one level deep.') if element.is_a?(Array)
    raise(ArgumentError, "Filter '#{element}' must be a String or Regexp. Got #{element.class}") unless str_regex?(element) # rubocop:disable Metrics/LineLength
  end
end