Class: SafeDb::Master
- Inherits:
-
Object
- Object
- SafeDb::Master
- Defined in:
- lib/model/master.rb
Overview
This master data structure controls the key publicly visible properties for the safe database be it in a local or remote location.
This object mapper seals away details of the persistence engine involved. Who knows, it could be a local drive, an S3 bucket and even a database.
Instance Method Summary collapse
-
#get_backend_coordinates ⇒ String
Get the coordinates (book, chapter and verse) of the verse that holds the remote backend properties.
-
#initialize ⇒ Master
constructor
Initialize an instance of this safe database’s master properties.
-
#set_backend_coordinates(backend_coordinates) ⇒ Object
Set the coordinates (book, chapter and verse) of the verse that holds the remote backend properties.
Constructor Details
#initialize ⇒ Master
Initialize an instance of this safe database’s master properties.
13 14 15 |
# File 'lib/model/master.rb', line 13 def initialize() @master = DataMap.new( Indices::MASTER_INDICES_FILEPATH ) end |
Instance Method Details
#get_backend_coordinates ⇒ String
Get the coordinates (book, chapter and verse) of the verse that holds the remote backend properties. An exception will be thrown if no backend coordinates have been set.
22 23 24 25 |
# File 'lib/model/master.rb', line 22 def get_backend_coordinates() @master.use( Indices::REMOTE_MIRROR_SECTION_NAME ) return @master.get( Indices::REMOTE_MIRROR_PAGE_NAME ) end |
#set_backend_coordinates(backend_coordinates) ⇒ Object
Set the coordinates (book, chapter and verse) of the verse that holds the remote backend properties.
31 32 33 34 |
# File 'lib/model/master.rb', line 31 def set_backend_coordinates( backend_coordinates ) @master.use( Indices::REMOTE_MIRROR_SECTION_NAME ) @master.set( Indices::REMOTE_MIRROR_PAGE_NAME, backend_coordinates ) end |