Class: CountVonCount::Formatters::Base
- Inherits:
-
Object
- Object
- CountVonCount::Formatters::Base
- Defined in:
- lib/count_von_count/formatter.rb
Instance Attribute Summary collapse
-
#output_dir ⇒ Object
readonly
Returns the value of attribute output_dir.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(path, output = nil) ⇒ Base
constructor
A new instance of Base.
- #write_output(countObj) ⇒ Object
Constructor Details
#initialize(path, output = nil) ⇒ Base
Returns a new instance of Base.
9 10 11 12 |
# File 'lib/count_von_count/formatter.rb', line 9 def initialize(path, output = nil) @path = path @output_dir = output end |
Instance Attribute Details
#output_dir ⇒ Object (readonly)
Returns the value of attribute output_dir.
8 9 10 |
# File 'lib/count_von_count/formatter.rb', line 8 def output_dir @output_dir end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
7 8 9 |
# File 'lib/count_von_count/formatter.rb', line 7 def path @path end |
Instance Method Details
#write_output(countObj) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/count_von_count/formatter.rb', line 14 def write_output(countObj) formatted = serialize(countObj) if output_dir write_file(formatted) else write_stdout(formatted) end end |