Class: DepsGrapher::Matcher
- Inherits:
-
Object
- Object
- DepsGrapher::Matcher
- Defined in:
- lib/deps_grapher/matcher.rb
Instance Method Summary collapse
-
#initialize(pattern) ⇒ Matcher
constructor
A new instance of Matcher.
- #match?(value) ⇒ Boolean
- #to_s ⇒ Object (also: #inspect)
Constructor Details
#initialize(pattern) ⇒ Matcher
Returns a new instance of Matcher.
5 6 7 |
# File 'lib/deps_grapher/matcher.rb', line 5 def initialize(pattern) @regexp = convert_to_regexp pattern end |
Instance Method Details
#match?(value) ⇒ Boolean
9 10 11 |
# File 'lib/deps_grapher/matcher.rb', line 9 def match?(value) @regexp.match? value end |
#to_s ⇒ Object Also known as: inspect
13 14 15 |
# File 'lib/deps_grapher/matcher.rb', line 13 def to_s @regexp.inspect end |