Class: Grepper::Result

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#fileObject (readonly)

Returns the value of attribute file.



243
244
245
# File 'lib/grepper.rb', line 243

def file
  @file
end

#matchesObject (readonly)

Returns the value of attribute matches.



243
244
245
# File 'lib/grepper.rb', line 243

def matches
  @matches
end