Class: CsvHelper::Base
- Inherits:
-
Object
- Object
- CsvHelper::Base
- Defined in:
- lib/csv_helper/base.rb
Constant Summary collapse
- CSV_RESULTS_DIR =
'/tmp'
Instance Method Summary collapse
- #filename ⇒ Object
- #filepath ⇒ Object
-
#initialize(result_id) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(result_id) ⇒ Base
Returns a new instance of Base.
6 7 8 9 10 |
# File 'lib/csv_helper/base.rb', line 6 def initialize(result_id) @result_id = result_id @tmp_results_dir = File.join(Rails.root, CSV_RESULTS_DIR) FileUtils.mkdir_p(@tmp_results_dir) end |
Instance Method Details
#filename ⇒ Object
16 17 18 |
# File 'lib/csv_helper/base.rb', line 16 def filename "#{@result_id}.csv" end |
#filepath ⇒ Object
12 13 14 |
# File 'lib/csv_helper/base.rb', line 12 def filepath File.join(@tmp_results_dir, filename) end |