Class: Glark::Count

Inherits:
Count show all
Defined in:
lib/glark/output/glark_count.rb

Instance Attribute Summary

Attributes inherited from Formatted

#formatted

Attributes inherited from Results

#count

Instance Method Summary collapse

Methods inherited from Count

#display_matches?, #process_end, #write_count

Methods inherited from Common

#add_match, #at_match_limit?, #display_matches?, #displayed_name, #process_match

Methods inherited from Formatted

#get_line_to_print

Methods inherited from Results

#add_match, #matched?

Constructor Details

#initialize(fname, spec) ⇒ Count

Returns a new instance of Count.



9
10
11
12
# File 'lib/glark/output/glark_count.rb', line 9

def initialize fname, spec
  super
  @fname_highlighter = spec.highlight && spec.file_highlight
end

Instance Method Details



19
20
21
# File 'lib/glark/output/glark_count.rb', line 19

def print_count ct
  @out.puts "    " + ct.to_s
end


14
15
16
17
# File 'lib/glark/output/glark_count.rb', line 14

def print_file_name
  file_header = FileHeader.new displayed_name, @fname_highlighter
  file_header.print @out
end