Method: CloudFiles::StorageObject#metadata

Defined in:
lib/cloudfiles/storage_object.rb

#metadataObject

Returns the object’s metadata as a nicely formatted hash, stripping off the X-Meta-Object- prefix that the system prepends to the key name.

object.metadata
=> {"ruby"=>"cool", "foo"=>"bar"}


108
109
110
111
112
# File 'lib/cloudfiles/storage_object.rb', line 108

def 
  metahash = {}
  @metadata.each{|key, value| metahash[key.gsub(/x-object-meta-/,'').gsub(/\+\-/, ' ')] = URI.decode(value).gsub(/\+\-/, ' ')}
  metahash
end