Class: Society::Formatter::Report::CSV
- Inherits:
-
Object
- Object
- Society::Formatter::Report::CSV
- Defined in:
- lib/society/formatter/report/csv.rb
Instance Attribute Summary collapse
-
#csv_data ⇒ Object
readonly
Returns the value of attribute csv_data.
-
#output_path ⇒ Object
readonly
Returns the value of attribute output_path.
Instance Method Summary collapse
-
#initialize(csv_data:, output_path: nil) ⇒ CSV
constructor
A new instance of CSV.
- #write ⇒ Object
Constructor Details
#initialize(csv_data:, output_path: nil) ⇒ CSV
Returns a new instance of CSV.
8 9 10 11 |
# File 'lib/society/formatter/report/csv.rb', line 8 def initialize(csv_data:, output_path: nil) @csv_data = csv_data @output_path = output_path end |
Instance Attribute Details
#csv_data ⇒ Object (readonly)
Returns the value of attribute csv_data.
6 7 8 |
# File 'lib/society/formatter/report/csv.rb', line 6 def csv_data @csv_data end |
#output_path ⇒ Object (readonly)
Returns the value of attribute output_path.
6 7 8 |
# File 'lib/society/formatter/report/csv.rb', line 6 def output_path @output_path end |
Instance Method Details
#write ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/society/formatter/report/csv.rb', line 13 def write if output_path prepare_output_directory write_csv_data else puts csv_data end end |