Class: Miasma::Models::Storage

Inherits:
Types::Api show all
Defined in:
lib/miasma/models/storage.rb,
lib/miasma/contrib/aws/storage.rb,
lib/miasma/models/storage/file.rb,
lib/miasma/models/storage/files.rb,
lib/miasma/models/storage/bucket.rb,
lib/miasma/models/storage/buckets.rb

Overview

Abstract storage API

Direct Known Subclasses

Aws

Defined Under Namespace

Classes: Aws, Bucket, Buckets, File, Files

Constant Summary collapse

MAX_BODY_SIZE_FOR_STRINGIFY =

Returns max bytes allowed for storing body in string.

Returns:

  • (Integer)

    max bytes allowed for storing body in string

102400
READ_BODY_CHUNK_SIZE =

Returns chunking size for reading IO.

Returns:

  • (Integer)

    chunking size for reading IO

102400

Instance Method Summary collapse

Methods inherited from Types::Api

#api_for, #connect, #connection, #endpoint, #format_response, #initialize, #make_request, #provider, #request

Methods included from Utils::Memoization

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

Methods included from Utils::Lazy

included

Constructor Details

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

Instance Method Details

#bucket_allArray<Models::Storage::Bucket>

Return all buckets

Returns:

Raises:

  • (NotImplementedError)


55
56
57
# File 'lib/miasma/models/storage.rb', line 55

def bucket_all
  raise NotImplementedError
end

#bucket_destroy(bucket) ⇒ TrueClass, FalseClass

Destroy bucket

Parameters:

Returns:

  • (TrueClass, FalseClass)

Raises:

  • (NotImplementedError)


40
41
42
# File 'lib/miasma/models/storage.rb', line 40

def bucket_destroy(bucket)
  raise NotImplementedError
end

#bucket_reload(bucket) ⇒ Models::Storage::Bucket

Reload the bucket

Parameters:

Returns:

Raises:

  • (NotImplementedError)


48
49
50
# File 'lib/miasma/models/storage.rb', line 48

def bucket_reload(bucket)
  raise NotImplementedError
end

#bucket_save(bucket) ⇒ Models::Storage::Bucket

Save bucket

Parameters:

Returns:

Raises:

  • (NotImplementedError)


32
33
34
# File 'lib/miasma/models/storage.rb', line 32

def bucket_save(bucket)
  raise NotImplementedError
end

#buckets(args = {}) ⇒ Types::Collection<Models::Storage::Bucket>

Storage buckets

Parameters:

  • filter (Hash)

    filtering options

Returns:



22
23
24
25
26
# File 'lib/miasma/models/storage.rb', line 22

def buckets(args={})
  memoize(:buckets) do
    Buckets.new(self)
  end
end

#file_all(bucket) ⇒ Array<File>

Return all files within bucket

Parameters:

Returns:

Raises:

  • (NotImplementedError)


63
64
65
# File 'lib/miasma/models/storage.rb', line 63

def file_all(bucket)
  raise NotImplementedError
end

#file_destroy(file) ⇒ TrueClass, FalseClass

Destroy file

Parameters:

Returns:

  • (TrueClass, FalseClass)

Raises:

  • (NotImplementedError)


79
80
81
# File 'lib/miasma/models/storage.rb', line 79

def file_destroy(file)
  raise NotImplementedError
end

#file_reload(file) ⇒ Models::Storage::File

Reload the file

Parameters:

Returns:

Raises:

  • (NotImplementedError)


87
88
89
# File 'lib/miasma/models/storage.rb', line 87

def file_reload(file)
  raise NotImplementedError
end

#file_save(file) ⇒ Models::Storage::File

Save file

Parameters:

Returns:

Raises:

  • (NotImplementedError)


71
72
73
# File 'lib/miasma/models/storage.rb', line 71

def file_save(file)
  raise NotImplementedError
end