Class: CukeSlicer::NestedTagCollection
- Inherits:
-
Object
- Object
- CukeSlicer::NestedTagCollection
- Includes:
- Helpers
- Defined in:
- lib/cuke_slicer/collections/nested_tag_collection.rb
Overview
private
Instance Method Summary collapse
-
#initialize(collection) ⇒ NestedTagCollection
constructor
A new instance of NestedTagCollection.
-
#validate ⇒ Object
private.
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
#validate ⇒ Object
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 |