Class: CsvHelper::Local
Constant Summary collapse
- LOCAL_RESULT_CSV =
'local_result_csvs'
Constants inherited from Base
Instance Attribute Summary collapse
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(result_id) ⇒ Local
constructor
A new instance of Local.
- #store! ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(result_id) ⇒ Local
Returns a new instance of Local.
7 8 9 10 11 12 |
# File 'lib/csv_helper/local.rb', line 7 def initialize(result_id) super(result_id) FileUtils.mkdir_p(File.join('public', LOCAL_RESULT_CSV)) @url = File.join(LOCAL_RESULT_CSV, filename) @local_url = File.join('public', @url) end |
Instance Attribute Details
#url ⇒ Object (readonly)
Returns the value of attribute url.
4 5 6 |
# File 'lib/csv_helper/local.rb', line 4 def url @url end |
Instance Method Details
#store! ⇒ Object
14 15 16 |
# File 'lib/csv_helper/local.rb', line 14 def store! FileUtils.copy(filepath, @local_url) end |