Class: Scrub::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/scrub.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



5
6
7
# File 'lib/scrub.rb', line 5

def initialize
  @matchers, @between_matchers = {}, {}
end

Instance Attribute Details

#between_matchersObject

Returns the value of attribute between_matchers.



4
5
6
# File 'lib/scrub.rb', line 4

def between_matchers
  @between_matchers
end

#matchersObject

Returns the value of attribute matchers.



4
5
6
# File 'lib/scrub.rb', line 4

def matchers
  @matchers
end

Instance Method Details

#between(beginning_matcher, end_matcher, options = {}, &block) ⇒ Object



11
12
13
# File 'lib/scrub.rb', line 11

def between beginning_matcher, end_matcher, options = {}, &block
  @between_matchers[beginning_matcher] = [end_matcher, block, {:when => /.*?/}.merge(options)]
end

#when(matcher, &block) ⇒ Object



8
9
10
# File 'lib/scrub.rb', line 8

def when matcher, &block
  @matchers[matcher] = block
end