Class: Guard::Watcher::Pattern::Matcher

Inherits:
Object
  • Object
show all
Defined in:
lib/guard/watcher/pattern/matcher.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(obj) ⇒ Matcher

Returns a new instance of Matcher


7
8
9
# File 'lib/guard/watcher/pattern/matcher.rb', line 7

def initialize(obj)
  @matcher = obj
end

Instance Attribute Details

#matcherObject (readonly)

Returns the value of attribute matcher


5
6
7
# File 'lib/guard/watcher/pattern/matcher.rb', line 5

def matcher
  @matcher
end

Instance Method Details

#==(other) ⇒ true, false

Compare with other matcher

Parameters:

Returns:

  • (true, false)

    equal or not


15
16
17
# File 'lib/guard/watcher/pattern/matcher.rb', line 15

def ==(other)
  matcher == other.matcher
end

#match(string_or_pathname) ⇒ Object


19
20
21
# File 'lib/guard/watcher/pattern/matcher.rb', line 19

def match(string_or_pathname)
  @matcher.match(normalized(string_or_pathname))
end