Class: Dressmaker::Configuration::FileMatcher

Inherits:
Matcher
  • Object
show all
Defined in:
lib/dressmaker/configuration/file_matcher.rb

Instance Attribute Summary

Attributes inherited from Matcher

#configuration

Instance Method Summary collapse

Methods inherited from Matcher

#update_description_on_rule

Constructor Details

#initialize(configuration) ⇒ FileMatcher

Returns a new instance of FileMatcher.



5
6
7
# File 'lib/dressmaker/configuration/file_matcher.rb', line 5

def initialize(configuration)
  @configuration = configuration
end

Instance Method Details

#all(&block) ⇒ Object



14
15
16
17
18
# File 'lib/dressmaker/configuration/file_matcher.rb', line 14

def all(&block)
  rule = FileRule::All.new(&block)
  update_description_on_rule(rule)
  configuration.rules << rule
end

#matches(pattern, &block) ⇒ Object



9
10
11
12
# File 'lib/dressmaker/configuration/file_matcher.rb', line 9

def matches(pattern, &block)
  rule = FileRule.new(pattern, &block)
  configuration.rules << rule
end