Module: GcloudStorage

Defined in:
lib/gcloud_storage.rb,
lib/gcloud_storage/base.rb,
lib/gcloud_storage/error.rb,
lib/gcloud_storage/version.rb,
lib/gcloud_storage/uploader.rb,
lib/gcloud_storage/local_store.rb,
lib/gcloud_storage/configuration.rb

Defined Under Namespace

Modules: Error, Uploader Classes: Base, Configuration, LocalStore

Constant Summary collapse

VERSION =
"0.0.5"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject

Returns the value of attribute configuration.



9
10
11
# File 'lib/gcloud_storage.rb', line 9

def configuration
  @configuration
end

.connectionObject

Returns the value of attribute connection.



9
10
11
# File 'lib/gcloud_storage.rb', line 9

def connection
  @connection
end

Class Method Details

.configure {|configuration| ... } ⇒ Object

Yields:



12
13
14
15
# File 'lib/gcloud_storage.rb', line 12

def self.configure
  self.configuration ||= Configuration.new
  yield(configuration)
end

.initialize_service!Object



21
22
23
24
25
26
27
# File 'lib/gcloud_storage.rb', line 21

def self.initialize_service!
  if self.configuration
    self.connection ||= Base.new(self.configuration.credentials)
  else
    Error.missing_credentials
  end
end

.serviceObject



17
18
19
# File 'lib/gcloud_storage.rb', line 17

def self.service
  self.connection || self.initialize_service!
end