Class: Mince::Config
Overview
Configuration for Mince
Mince can be configured to interact with different mince supported data interfaces.
Simply run the following to specify the data interface to use Mince::Config.interface = Mince::MyDb::Interface
This is a singleton object in order to prevent multiple instances of this object from being used.
Instance Attribute Summary collapse
-
#interface ⇒ Object
Returns the value of attribute interface.
Class Method Summary collapse
-
.interface ⇒ Object
Returns the interface that is configured to be used.
-
.interface=(interface) ⇒ Object
Sets the singleton's interface attribute so that you can change your storage strategy without changing all references to that class.
Instance Attribute Details
#interface ⇒ Object
Returns the value of attribute interface.
16 17 18 |
# File 'lib/mince/config.rb', line 16 def interface @interface end |
Class Method Details
.interface ⇒ Object
Returns the interface that is configured to be used. Use this method instead of hard coding which mince interface to use throughout your code so that you can change mince interfaces as needed.
29 30 31 |
# File 'lib/mince/config.rb', line 29 def self.interface instance.interface end |
.interface=(interface) ⇒ Object
Sets the singleton's interface attribute so that you can change your storage strategy without changing all references to that class.
22 23 24 |
# File 'lib/mince/config.rb', line 22 def self.interface=(interface) instance.interface = interface end |