Sha256: 4f4f6912055125071e9dba7f53c942781c1e9d94b8553bedb3e81525a92373c0

Contents?: true

Size: 1.18 KB

Versions: 16

Compression:

Stored size: 1.18 KB

Contents

require "fog/brightbox/models/storage/files"

module Fog
  module Storage
    class Brightbox
      class Directory < Fog::Model
        identity :key, :aliases => "name"

        attribute :bytes, :aliases => "X-Container-Bytes-Used"
        attribute :count, :aliases => "X-Container-Object-Count"
        attribute :read_permissions, :aliases => "X-Container-Read"
        attribute :write_permissions, :aliases => "X-Container-Write"

        def destroy
          requires :key
          service.delete_container(key)
          true
        rescue Excon::Errors::NotFound
          false
        end

        def files
          @files ||= begin
            Fog::Storage::Brightbox::Files.new(
              :directory    => self,
              :service   => service
            )
          end
        end

        attr_writer :public

        def public_url
          # raise NotImplementedError
          ""
        end

        def save
          requires :key
          options = {
            "read_permissions" => read_permissions,
            "write_permissions" => write_permissions
          }
          service.put_container(key, options)
          true
        end
      end
    end
  end
end

Version data entries

16 entries across 14 versions & 3 rubygems

Version Path
fog-brightbox-1.0.0.rc1 lib/fog/brightbox/models/storage/directory.rb
fog-brightbox-0.16.1 lib/fog/brightbox/models/storage/directory.rb
fog-brightbox-0.16.0 lib/fog/brightbox/models/storage/directory.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-brightbox-0.15.0/lib/fog/brightbox/models/storage/directory.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-brightbox-0.15.0/lib/fog/brightbox/models/storage/directory.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-brightbox-0.15.0/lib/fog/brightbox/models/storage/directory.rb
fog-brightbox-0.15.0 lib/fog/brightbox/models/storage/directory.rb
fog-brightbox-0.14.0 lib/fog/brightbox/models/storage/directory.rb
fog-brightbox-0.13.0 lib/fog/brightbox/models/storage/directory.rb
fog-brightbox-0.12.0 lib/fog/brightbox/models/storage/directory.rb
fog-brightbox-0.11.0 lib/fog/brightbox/models/storage/directory.rb
fog-brightbox-0.10.1 lib/fog/brightbox/models/storage/directory.rb
fog-brightbox-0.10.0 lib/fog/brightbox/models/storage/directory.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-brightbox-0.9.0/lib/fog/brightbox/models/storage/directory.rb
fog-brightbox-0.9.0 lib/fog/brightbox/models/storage/directory.rb
fog-brightbox-0.8.0 lib/fog/brightbox/models/storage/directory.rb