Sha256: 73d1acc7c94aabec553d4f8b91ce229891f9b41026a3e0e6c70118bb3ebfe2a8

Contents?: true

Size: 711 Bytes

Versions: 3

Compression:

Stored size: 711 Bytes

Contents

module Fog
  module Local
    class Storage
      class Directory < Fog::Model
        identity  :key

        def destroy
          requires :key

          if ::File.directory?(path)
            Dir.rmdir(path)
            true
          else
            false
          end
        end

        def files
          @files ||= Files.new(directory: self, service: service)
        end

        def public=(new_public)
          new_public
        end

        def public_url
          nil
        end

        def save
          requires :key

          FileUtils.mkpath(path)
          true
        end

        private

        def path
          service.path_to(key)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fog-local-0.8.0 lib/fog/local/models/directory.rb
fog-local-0.7.0 lib/fog/local/models/directory.rb
fog-local-0.6.0 lib/fog/local/models/directory.rb