Class: SwiftStorage::Account

Inherits:
Node
  • Object
show all
Defined in:
lib/swift_storage/account.rb

Instance Attribute Summary

Attributes inherited from Node

#name, #parent

Instance Method Summary collapse

Methods inherited from Node

#clear_cache, #delete, #delete_if_exists, #exists?, #get_lines, #headers, #initialize, #metadata, #request, #service, #to_s

Methods included from Utils

#hmac, #sig_to_hex, #struct

Constructor Details

This class inherits a constructor from SwiftStorage::Node

Instance Method Details

#relative_pathObject



29
30
31
# File 'lib/swift_storage/account.rb', line 29

def relative_path
  ''
end

#temp_url_keyString

Returns the temporary URL key

Returns:

  • (String)

    Key used to sign temporary URLs



25
26
27
# File 'lib/swift_storage/account.rb', line 25

def temp_url_key
  .temp_url_key rescue nil
end

#write(temp_url_key: nil) ⇒ Object

Write account meta data

Parameters:

  • temp_url_key (String) (defaults to: nil)

    The shared secret used to sign temporary URLs. Changing this key will invalidate all temporary URLs signed with the older key.



13
14
15
16
17
18
# File 'lib/swift_storage/account.rb', line 13

def write(temp_url_key: nil)
  h = {}
  h[H::] = temp_url_key if temp_url_key

  request(relative_path, :method => :post, :headers => h)
end