Class: Glark::Count
- Defined in:
- lib/glark/output/glark_count.rb
Instance Attribute Summary
Attributes inherited from Formatted
Attributes inherited from Results
Instance Method Summary collapse
-
#initialize(fname, spec) ⇒ Count
constructor
A new instance of Count.
- #print_count(ct) ⇒ Object
- #print_file_name ⇒ Object
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
Methods inherited from Results
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
#print_count(ct) ⇒ Object
19 20 21 |
# File 'lib/glark/output/glark_count.rb', line 19 def print_count ct @out.puts " " + ct.to_s end |
#print_file_name ⇒ Object
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 |