Class: DepsGrapher::Matcher

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

Instance Method Summary collapse

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

Returns:

  • (Boolean)


9
10
11
# File 'lib/deps_grapher/matcher.rb', line 9

def match?(value)
  @regexp.match? value
end

#to_sObject Also known as: inspect



13
14
15
# File 'lib/deps_grapher/matcher.rb', line 13

def to_s
  @regexp.inspect
end