Class: Dressmaker::Configuration::DirectoryMatcher

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Matcher

#update_description_on_rule

Constructor Details

#initialize(configuration) ⇒ DirectoryMatcher

Returns a new instance of DirectoryMatcher.



7
8
9
# File 'lib/dressmaker/configuration/directory_matcher.rb', line 7

def initialize(configuration)
  @configuration = configuration
end

Instance Attribute Details

#configurationObject (readonly)

Returns the value of attribute configuration.



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

def configuration
  @configuration
end

Instance Method Details

#all(&block) ⇒ Object



17
18
19
20
21
# File 'lib/dressmaker/configuration/directory_matcher.rb', line 17

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

#matches(pattern, &block) ⇒ Object



11
12
13
14
15
# File 'lib/dressmaker/configuration/directory_matcher.rb', line 11

def matches(pattern, &block)
  rule = DirectoryRule::Pattern.new(pattern, &block)
  update_description_on_rule(rule)
  configuration.rules << rule
end