Sha256: cbb80408f77e8c1f224b38ddd34918008d64259c5e276aa244e6b5b15aae9d84

Contents?: true

Size: 790 Bytes

Versions: 8

Compression:

Stored size: 790 Bytes

Contents

module Mongoo
  module GridFs

    class Files
      def initialize(container_hash, db_lambda)
        @db_lambda = db_lambda
        @container_hash = container_hash
      end

      def get(*args)
        key = args.shift
        if @container_hash[key]
          Mongoo::GridFs::File.new(@container_hash[key], @db_lambda).get(*args)
        end
      end

      def put(*args)
        key = args.shift
        unless @container_hash[key]
          @container_hash[key] = {}
        end
        Mongoo::GridFs::File.new(@container_hash[key], @db_lambda).put(*args)
      end

      def delete(*args)
        key = args.shift
        if @container_hash[key]
          Mongoo::GridFs::File.new(@container_hash[key], @db_lambda).delete(*args)
        end
      end
    end # Files

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
mongoo-0.5.7 lib/mongoo/grid_fs/files.rb
mongoo-0.5.6 lib/mongoo/grid_fs/files.rb
mongoo-0.5.5 lib/mongoo/grid_fs/files.rb
mongoo-0.5.4 lib/mongoo/grid_fs/files.rb
mongoo-0.5.3 lib/mongoo/grid_fs/files.rb
mongoo-0.5.2 lib/mongoo/grid_fs/files.rb
mongoo-0.5.1 lib/mongoo/grid_fs/files.rb
mongoo-0.5.0 lib/mongoo/grid_fs/files.rb