Class: Miasma::Models::Storage

Inherits:
Types::Api show all
Defined in:
lib/miasma/models/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

Defined Under Namespace

Classes: Bucket, Buckets, File, Files

Constant Summary

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)

Constructor Details

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

Instance Method Details

- (Array<Models::Storage::Bucket>) bucket_all

Return all buckets

Returns:

Raises:

  • (NotImplementedError)


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

def bucket_all
  raise NotImplementedError
end

- (TrueClass, FalseClass) bucket_destroy(bucket)

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

- (Models::Storage::Bucket) bucket_reload(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

- (Models::Storage::Bucket) bucket_save(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

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

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

- (Array<File>) file_all(bucket)

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

- (TrueClass, FalseClass) file_destroy(file)

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

- (Models::Storage::File) file_reload(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

- (Models::Storage::File) file_save(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