Class: IseshimaStore::Connection
- Inherits:
-
Object
- Object
- IseshimaStore::Connection
- Defined in:
- lib/iseshima_store/connection.rb
Class Attribute Summary collapse
-
.config ⇒ Object
Returns the value of attribute config.
Class Method Summary collapse
- .clear_connection! ⇒ Object
- .configure {|config| ... } ⇒ Object
- .current ⇒ Object
- .datastore ⇒ Object
Class Attribute Details
.config ⇒ Object
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
9 10 11 12 |
# File 'lib/iseshima_store/connection.rb', line 9 def self.configure(&block) self.config ||= OpenStruct.new yield(config) end |
.current ⇒ Object
18 19 20 |
# File 'lib/iseshima_store/connection.rb', line 18 def self.current @current ||= Gcloud.datastore(config.project_id) end |
.datastore ⇒ Object
14 15 16 |
# File 'lib/iseshima_store/connection.rb', line 14 def self.datastore Gcloud.datastore(config.project_id) end |