Class: Adhoq::Storage::LocalFile

Inherits:
FogStorage show all
Defined in:
lib/adhoq/storage/local_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#rootObject (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

#identifierObject



15
16
17
# File 'lib/adhoq/storage/local_file.rb', line 15

def identifier
  "file://#{[@fog.local_root, @dir].join('/')}"
end