Class: Miasma::Models::Storage::Buckets

Inherits:
Types::Collection show all
Defined in:
lib/miasma/models/storage/buckets.rb

Overview

Abstract bucket collection

Instance Attribute Summary

Attributes inherited from Types::Collection

#api

Instance Method Summary collapse

Methods inherited from Types::Collection

#all, #from_json, #get, #initialize, #reload, #to_json

Methods included from Utils::Memoization

#_memo, #clear_memoizations!, #memoize, #unmemoize

Constructor Details

This class inherits a constructor from Miasma::Types::Collection

Instance Method Details

#build(args = {}) ⇒ Bucket

Returns new unsaved instance.

Returns:

  • (Bucket)

    new unsaved instance



21
22
23
# File 'lib/miasma/models/storage/buckets.rb', line 21

def build(args={})
  Bucket.new(api, args.to_smash)
end

#filter(options = {}) ⇒ Array<Bucket>

Return buckets matching given filter

Parameters:

  • options (Hash) (defaults to: {})

    filter options

Options Hash (options):

  • :prefix (String)

    key prefix

Returns:

Raises:

  • (NotImplementedError)


16
17
18
# File 'lib/miasma/models/storage/buckets.rb', line 16

def filter(options={})
  raise NotImplementedError
end

#modelBucket

Returns collection item class.

Returns:

  • (Bucket)

    collection item class



26
27
28
# File 'lib/miasma/models/storage/buckets.rb', line 26

def model
  Bucket
end