Module: Azure::Storage::Configurable

Included in:
Azure::Storage, Client
Defined in:
lib/azure/storage/configurable.rb

Overview

The Azure::Storage::Configurable module provides basic configuration for Azure storage activities.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#storage_access_keyObject

Returns the value of attribute storage_access_key


45
46
47
# File 'lib/azure/storage/configurable.rb', line 45

def storage_access_key
  @storage_access_key
end

#storage_account_nameString

Returns Azure Storage account name.

Returns:

  • (String)

    Azure Storage account name.


45
46
47
# File 'lib/azure/storage/configurable.rb', line 45

attr_accessor :storage_access_key,
:storage_account_name,
:storage_connection_string

#storage_blob_hostString

Storage blob host

Returns:


45
46
47
# File 'lib/azure/storage/configurable.rb', line 45

attr_accessor :storage_access_key,
:storage_account_name,
:storage_connection_string

#storage_connection_stringString

Returns Azure Storage connection string.

Returns:

  • (String)

    Azure Storage connection string.


45
46
47
# File 'lib/azure/storage/configurable.rb', line 45

attr_accessor :storage_access_key,
:storage_account_name,
:storage_connection_string

#storage_queue_hostString

Storage queue host

Returns:


45
46
47
# File 'lib/azure/storage/configurable.rb', line 45

attr_accessor :storage_access_key,
:storage_account_name,
:storage_connection_string

#storage_table_hostString

Storage table host

Returns:


45
46
47
# File 'lib/azure/storage/configurable.rb', line 45

attr_accessor :storage_access_key,
:storage_account_name,
:storage_connection_string

Class Method Details

.keysArray

List of configurable keys for Client

Returns:

  • (Array)

    of option keys


56
57
58
59
60
61
62
63
64
65
# File 'lib/azure/storage/configurable.rb', line 56

def keys
  @keys ||= [
    :storage_access_key,
    :storage_account_name,
    :storage_connection_string,
    :storage_table_host,
    :storage_blob_host,
    :storage_queue_host
  ]
end

Instance Method Details

#configObject


113
114
115
# File 'lib/azure/storage/configurable.rb', line 113

def config
  self
end

#configure {|_self| ... } ⇒ Object

Set configuration options using a block

Yields:

  • (_self)

Yield Parameters:


69
70
71
# File 'lib/azure/storage/configurable.rb', line 69

def configure
  yield self
end

#reset_config!(options = {}) ⇒ Object Also known as: setup

Reset configuration options to default values


74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/azure/storage/configurable.rb', line 74

def reset_config!(options = {})
  Azure::Storage::Configurable.keys.each do |key|
    value = if self == Azure::Storage
              Azure::Storage::Default.options[key]
            else
              Azure::Storage.send(key)
            end
    instance_variable_set(:"@#{key}", options.fetch(key, value))
  end
  self.send(:reset_agents!) if self.respond_to?(:reset_agents!)
  self
end

#storage_file_hostString

Storage file host

Returns:


109
110
111
# File 'lib/azure/storage/configurable.rb', line 109

def storage_file_host
  @storage_file_host || default_host(:file)
end