Class: ActiveAdmin::AsyncExporter::Services::DiskService
- Inherits:
-
Object
- Object
- ActiveAdmin::AsyncExporter::Services::DiskService
- Defined in:
- lib/active_admin/async_exporter/services/disk_service.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
Returns the value of attribute file.
-
#folder ⇒ Object
Returns the value of attribute folder.
Instance Method Summary collapse
- #delete ⇒ Object
-
#initialize(file) ⇒ DiskService
constructor
A new instance of DiskService.
- #store ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(file) ⇒ DiskService
Returns a new instance of DiskService.
9 10 11 12 |
# File 'lib/active_admin/async_exporter/services/disk_service.rb', line 9 def initialize(file) @file = file @folder = ActiveAdmin::AsyncExporter.config.disk_folder_path end |
Instance Attribute Details
#file ⇒ Object
Returns the value of attribute file.
7 8 9 |
# File 'lib/active_admin/async_exporter/services/disk_service.rb', line 7 def file @file end |
#folder ⇒ Object
Returns the value of attribute folder.
7 8 9 |
# File 'lib/active_admin/async_exporter/services/disk_service.rb', line 7 def folder @folder end |
Instance Method Details
#delete ⇒ Object
24 25 26 |
# File 'lib/active_admin/async_exporter/services/disk_service.rb', line 24 def delete File.delete(filename) end |
#store ⇒ Object
14 15 16 17 18 |
# File 'lib/active_admin/async_exporter/services/disk_service.rb', line 14 def store make_dir @object = IO.copy_stream(file[:path], filename) self end |
#url ⇒ Object
20 21 22 |
# File 'lib/active_admin/async_exporter/services/disk_service.rb', line 20 def url filename end |