Class: AzureBlob::Tags
- Inherits:
-
Object
- Object
- AzureBlob::Tags
- Defined in:
- lib/azure_blob/tags.rb
Overview
:nodoc:
Class Method Summary collapse
Instance Method Summary collapse
- #headers ⇒ Object
-
#initialize(tags = nil) ⇒ Tags
constructor
A new instance of Tags.
- #to_h ⇒ Object
Constructor Details
#initialize(tags = nil) ⇒ Tags
Returns a new instance of Tags.
16 17 18 |
# File 'lib/azure_blob/tags.rb', line 16 def initialize( = nil) @tags = || {} end |
Class Method Details
.from_response(response) ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/azure_blob/tags.rb', line 5 def self.from_response(response) document = REXML::Document.new(response) = {} document.elements.each("Tags/TagSet/Tag") do |tag| key = tag.elements["Key"].text value = tag.elements["Value"].text [key] = value end new() end |
Instance Method Details
#headers ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/azure_blob/tags.rb', line 20 def headers return {} if @tags.empty? { "x-ms-tags": @tags.map do |key, value| %(#{key}=#{value}) end.join("&"), } end |
#to_h ⇒ Object
31 32 33 |
# File 'lib/azure_blob/tags.rb', line 31 def to_h @tags end |