class SafeDb::Set
The set use case is the generic tool for setting book scoped configuration directives. These directives can only be read, written, updated or removed during a logged in branch.
The mirror of this use case is unset.
Observable Value¶ ↑
The configuration directive will either be created or overwriten within the book's configuration store.
Attributes
directive_name[W]
directive_value[W]
Public Instance Methods
execute()
click to toggle source
The set use case is the generic tool for setting book scoped configuration directives. These directives can only be read, written, updated or removed during a logged in branch.
# File lib/controller/set.rb, line 23 def execute return unless ops_key_exists? master_db = Book.read() master_db[ @directive_name ] = @directive_value puts "" puts JSON.pretty_generate( master_db ) puts "" Book.write( create_header(), master_db ) end