Class: Machete::Matchers::RegexpMatcher

Inherits:
Matcher
  • Object
show all
Defined in:
lib/machete/matchers.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(regexp) ⇒ RegexpMatcher

Returns a new instance of RegexpMatcher.



139
140
141
# File 'lib/machete/matchers.rb', line 139

def initialize(regexp)
  @regexp = regexp
end

Instance Attribute Details

#regexpObject (readonly)

Returns the value of attribute regexp.



137
138
139
# File 'lib/machete/matchers.rb', line 137

def regexp
  @regexp
end

Instance Method Details

#==(other) ⇒ Object



143
144
145
# File 'lib/machete/matchers.rb', line 143

def ==(other)
  other.instance_of?(self.class) && @regexp == other.regexp
end