Class: IseshimaStore::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/iseshima_store/connection.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configObject

Returns the value of attribute config.



6
7
8
# File 'lib/iseshima_store/connection.rb', line 6

def config
  @config
end

Class Method Details

.clear_connection!Object



22
23
24
# File 'lib/iseshima_store/connection.rb', line 22

def self.clear_connection!
  @current = nil
end

.configure {|config| ... } ⇒ Object

Yields:



9
10
11
12
# File 'lib/iseshima_store/connection.rb', line 9

def self.configure(&block)
  self.config ||= OpenStruct.new
  yield(config)
end

.currentObject



18
19
20
# File 'lib/iseshima_store/connection.rb', line 18

def self.current
  @current ||= Gcloud.datastore(config.project_id)
end

.datastoreObject



14
15
16
# File 'lib/iseshima_store/connection.rb', line 14

def self.datastore
  Gcloud.datastore(config.project_id)
end