Class: CukeSlicer::NestedTagCollection
- Inherits:
-
Object
- Object
- CukeSlicer::NestedTagCollection
- Includes:
- Helpers
- Defined in:
- lib/cuke_slicer/collections/nested_tag_collection.rb
Instance Method Summary collapse
-
#initialize(collection) ⇒ NestedTagCollection
constructor
A new instance of NestedTagCollection.
- #validate ⇒ Object
Methods included from Helpers
#is_path?, #is_tag?, #str_regex?, #str_regex_arr?
Constructor Details
#initialize(collection) ⇒ NestedTagCollection
Returns a new instance of NestedTagCollection.
10 11 12 |
# File 'lib/cuke_slicer/collections/nested_tag_collection.rb', line 10 def initialize collection self.nested_collection = collection end |
Instance Method Details
#validate ⇒ Object
14 15 16 17 18 19 |
# File 'lib/cuke_slicer/collections/nested_tag_collection.rb', line 14 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) end end |