Class: Storage
- Inherits:
-
Object
- Object
- Storage
- Defined in:
- lib/wingify/packages/storage/storage.rb
Instance Attribute Summary collapse
-
#connector ⇒ Object
readonly
Returns the value of attribute connector.
-
#is_storage_enabled ⇒ Object
Returns the value of attribute is_storage_enabled.
Class Method Summary collapse
-
.instance ⇒ Object
Singleton instance method.
Instance Method Summary collapse
-
#attach_connector(connector) ⇒ Object
Attach a connector (can be an instance or a class).
-
#get_connector ⇒ Object
Get the attached connector.
-
#initialize ⇒ Storage
constructor
A new instance of Storage.
Constructor Details
#initialize ⇒ Storage
Returns a new instance of Storage.
23 24 25 26 |
# File 'lib/wingify/packages/storage/storage.rb', line 23 def initialize @connector = nil @is_storage_enabled = false end |
Instance Attribute Details
#connector ⇒ Object (readonly)
Returns the value of attribute connector.
20 21 22 |
# File 'lib/wingify/packages/storage/storage.rb', line 20 def connector @connector end |
#is_storage_enabled ⇒ Object
Returns the value of attribute is_storage_enabled.
21 22 23 |
# File 'lib/wingify/packages/storage/storage.rb', line 21 def is_storage_enabled @is_storage_enabled end |
Class Method Details
.instance ⇒ Object
Singleton instance method
39 40 41 |
# File 'lib/wingify/packages/storage/storage.rb', line 39 def self.instance @instance ||= new end |
Instance Method Details
#attach_connector(connector) ⇒ Object
Attach a connector (can be an instance or a class)
29 30 31 32 33 34 35 36 |
# File 'lib/wingify/packages/storage/storage.rb', line 29 def attach_connector(connector) if connector.is_a?(Class) # Check if it's a class before instantiating @connector = connector.new else @connector = connector end @connector end |
#get_connector ⇒ Object
Get the attached connector
44 45 46 |
# File 'lib/wingify/packages/storage/storage.rb', line 44 def get_connector @connector end |