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.
=> {"ruby"=>"cool", "foo"=>"bar"}


134
135
136
137
138
# File 'lib/cloudfiles/storage_object.rb', line 134

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