Class: Grepper::Result
- Inherits:
-
Object
- Object
- Grepper::Result
- Defined in:
- lib/grepper.rb
Overview
Grepper::Result represents the matches from a single file. It connects the filename (the file
attribute) with a set of Match objects (the matches
attribute).
Result objects are created automatically by the Grepper object when you run it.
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#matches ⇒ Object
readonly
Returns the value of attribute matches.
Instance Method Summary collapse
-
#initialize(file) ⇒ Result
constructor
A new instance of Result.
Constructor Details
#initialize(file) ⇒ Result
Returns a new instance of Result.
244 245 246 247 |
# File 'lib/grepper.rb', line 244 def initialize(file) @file = file @matches = [].extend(MatchesExtension) end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
243 244 245 |
# File 'lib/grepper.rb', line 243 def file @file end |
#matches ⇒ Object (readonly)
Returns the value of attribute matches.
243 244 245 |
# File 'lib/grepper.rb', line 243 def matches @matches end |