Class: Adhoq::Storage::LocalFile
- Inherits:
-
FogStorage
- Object
- FogStorage
- Adhoq::Storage::LocalFile
- Defined in:
- lib/adhoq/storage/local_file.rb
Instance Attribute Summary collapse
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Instance Method Summary collapse
- #identifier ⇒ Object
-
#initialize(root_path) ⇒ LocalFile
constructor
A new instance of LocalFile.
Methods inherited from FogStorage
#direct_download?, #get, #get_raw, #store
Constructor Details
#initialize(root_path) ⇒ LocalFile
Returns a new instance of LocalFile.
8 9 10 11 12 13 |
# File 'lib/adhoq/storage/local_file.rb', line 8 def initialize(root_path) path = Pathname.new(root_path) @fog = Fog::Storage.new(provider: 'Local', local_root: path.parent) @dir = path.basename.to_s end |
Instance Attribute Details
#root ⇒ Object (readonly)
Returns the value of attribute root.
6 7 8 |
# File 'lib/adhoq/storage/local_file.rb', line 6 def root @root end |
Instance Method Details
#identifier ⇒ Object
15 16 17 |
# File 'lib/adhoq/storage/local_file.rb', line 15 def identifier "file://#{[@fog.local_root, @dir].join('/')}" end |