Class: AzureClient::Blob
- Inherits:
-
Object
- Object
- AzureClient::Blob
- Defined in:
- lib/azure_client/blob.rb
Instance Method Summary collapse
- #delete(retry_policy = @retry_policy) ⇒ Object
- #get_content ⇒ Object
-
#initialize(name, azure_blob, content, container_name, blob_service, retry_policy) ⇒ Blob
constructor
A new instance of Blob.
Constructor Details
#initialize(name, azure_blob, content, container_name, blob_service, retry_policy) ⇒ Blob
Returns a new instance of Blob.
4 5 6 7 8 9 10 11 |
# File 'lib/azure_client/blob.rb', line 4 def initialize(name, azure_blob, content, container_name, blob_service, retry_policy) @name = name @azure_blob = azure_blob @content = content @container_name = container_name @blob_service = blob_service @retry_policy = retry_policy end |
Instance Method Details
#delete(retry_policy = @retry_policy) ⇒ Object
21 22 23 24 25 |
# File 'lib/azure_client/blob.rb', line 21 def delete(retry_policy = @retry_policy) retry_policy.retry { @blob_service.delete_blob(@container_name, @name) } end |
#get_content ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/azure_client/blob.rb', line 13 def get_content content_encoding = @blob_service.get_blob_properties(@container_name, @name).properties[:content_encoding] if (content_encoding && content_encoding.downcase == "gzip") return Compression.decompress(@content) end @content end |