Class: Miasma::Models::Storage
- Inherits:
-
Types::Api
- Object
- Types::Api
- Miasma::Models::Storage
- 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
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.
102400
- READ_BODY_CHUNK_SIZE =
Returns chunking size for reading IO.
102400
Instance Method Summary collapse
-
#bucket_all ⇒ Array<Models::Storage::Bucket>
Return all buckets.
-
#bucket_destroy(bucket) ⇒ TrueClass, FalseClass
Destroy bucket.
-
#bucket_reload(bucket) ⇒ Models::Storage::Bucket
Reload the bucket.
-
#bucket_save(bucket) ⇒ Models::Storage::Bucket
Save bucket.
-
#buckets(args = {}) ⇒ Types::Collection<Models::Storage::Bucket>
Storage buckets.
-
#file_all(bucket) ⇒ Array<File>
Return all files within bucket.
-
#file_destroy(file) ⇒ TrueClass, FalseClass
Destroy file.
-
#file_reload(file) ⇒ Models::Storage::File
Reload the file.
-
#file_save(file) ⇒ Models::Storage::File
Save file.
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
Constructor Details
This class inherits a constructor from Miasma::Types::Api
Instance Method Details
#bucket_all ⇒ Array<Models::Storage::Bucket>
Return all buckets
55 56 57 |
# File 'lib/miasma/models/storage.rb', line 55 def bucket_all raise NotImplementedError end |
#bucket_destroy(bucket) ⇒ TrueClass, FalseClass
Destroy bucket
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
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
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
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
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
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
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
71 72 73 |
# File 'lib/miasma/models/storage.rb', line 71 def file_save(file) raise NotImplementedError end |