Class: Rubygrep::Matcher
- Inherits:
-
Object
- Object
- Rubygrep::Matcher
- Defined in:
- lib/rubygrep/matcher.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
-
#regexp ⇒ Object
Returns the value of attribute regexp.
Instance Method Summary collapse
-
#initialize(regexp, options = {}) ⇒ Matcher
constructor
A new instance of Matcher.
- #matches?(string_data) ⇒ Boolean
Constructor Details
#initialize(regexp, options = {}) ⇒ Matcher
Returns a new instance of Matcher.
5 6 7 8 |
# File 'lib/rubygrep/matcher.rb', line 5 def initialize(regexp, = {}) @options = @regexp = (regexp) end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
3 4 5 |
# File 'lib/rubygrep/matcher.rb', line 3 def @options end |
#regexp ⇒ Object
Returns the value of attribute regexp.
3 4 5 |
# File 'lib/rubygrep/matcher.rb', line 3 def regexp @regexp end |
Instance Method Details
#matches?(string_data) ⇒ Boolean
10 11 12 |
# File 'lib/rubygrep/matcher.rb', line 10 def matches?(string_data) regexp.match(string_data[:str]) end |