Sha256: 0fc21371f4a8031abde53ca9b655302d3fbceeeeb7315cda126170d62f5bed3e

Contents?: true

Size: 941 Bytes

Versions: 2

Compression:

Stored size: 941 Bytes

Contents

                                                                                           
module AssetCloud
  class AssetNotFoundError < StandardError
    def initialize(key, version=nil)
      super(version ? "Could not find version #{version} of asset #{key}" : "Could not find asset #{key}")
    end
  end
  
  class Bucket
    attr_reader :name
    attr_accessor :cloud
    
    def initialize(cloud, name)
      @cloud, @name = cloud, name
    end
    
    def ls(key = nil)     
      raise NotImplementedError
    end                               

    def read(key)  
      raise NotImplementedError
    end          

    def write(key, data)       
      raise NotImplementedError
    end   

    def delete(key)
      raise NotImplementedError
    end
    
    # versioning
    # 
    # implement #read_version(key, version) and #versions(key) in subclasses
    def versioned?
      respond_to?(:read_version)
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
Shopify-asset_cloud-0.5.4 lib/asset_cloud/bucket.rb
jamesmacaulay-asset_cloud-0.5.4 lib/asset_cloud/bucket.rb