Class: Pansophy::Remote::Directory
- Inherits:
-
Object
- Object
- Pansophy::Remote::Directory
- Includes:
- Adamantium::Flat
- Defined in:
- lib/pansophy/remote/directory.rb
Instance Method Summary collapse
- #create(options) ⇒ Object
- #create_file(path, body, options = {}) ⇒ Object
- #files ⇒ Object
-
#initialize(bucket_name, path = nil) ⇒ Directory
constructor
A new instance of Directory.
- #pathname ⇒ Object
Constructor Details
#initialize(bucket_name, path = nil) ⇒ Directory
Returns a new instance of Directory.
6 7 8 9 |
# File 'lib/pansophy/remote/directory.rb', line 6 def initialize(bucket_name, path = nil) @bucket_name = bucket_name @path = path.to_s end |
Instance Method Details
#create(options) ⇒ Object
20 21 22 23 |
# File 'lib/pansophy/remote/directory.rb', line 20 def create() remove() directory.files.create(key: pathname.cleanpath.to_s + '/') end |
#create_file(path, body, options = {}) ⇒ Object
25 26 27 |
# File 'lib/pansophy/remote/directory.rb', line 25 def create_file(path, body, = {}) CreateFile.new(@bucket_name, pathname.join(path), body).call() end |
#files ⇒ Object
16 17 18 |
# File 'lib/pansophy/remote/directory.rb', line 16 def files remote_files.map { |file| File.new(file) } end |
#pathname ⇒ Object
11 12 13 |
# File 'lib/pansophy/remote/directory.rb', line 11 def pathname Pathname.new(@path) end |