Class: Scrub::Config
- Inherits:
-
Object
- Object
- Scrub::Config
- Defined in:
- lib/scrub.rb
Instance Attribute Summary collapse
-
#between_matchers ⇒ Object
Returns the value of attribute between_matchers.
-
#matchers ⇒ Object
Returns the value of attribute matchers.
Instance Method Summary collapse
- #between(beginning_matcher, end_matcher, options = {}, &block) ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #when(matcher, &block) ⇒ Object
Constructor Details
#initialize ⇒ Config
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_matchers ⇒ Object
Returns the value of attribute between_matchers.
4 5 6 |
# File 'lib/scrub.rb', line 4 def between_matchers @between_matchers end |
#matchers ⇒ Object
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, = {}, &block @between_matchers[beginning_matcher] = [end_matcher, block, {:when => /.*?/}.merge()] end |
#when(matcher, &block) ⇒ Object
8 9 10 |
# File 'lib/scrub.rb', line 8 def when matcher, &block @matchers[matcher] = block end |