Class: Output::FileAndLine

Inherits:
Object
  • Object
show all
Defined in:
lib/output/file_and_line.rb

Instance Method Summary collapse

Constructor Details

#initialize(grepmate) ⇒ FileAndLine

Returns a new instance of FileAndLine.



3
4
5
# File 'lib/output/file_and_line.rb', line 3

def initialize(grepmate)
  @grepmate = grepmate
end

Instance Method Details

#processObject



7
8
9
10
11
12
13
14
15
# File 'lib/output/file_and_line.rb', line 7

def process
  @grepmate.results.each{|line|
    if line
      puts line.split(':')[0..1].join(':')
    else
      puts line
    end
  }
end