Class: SafeDb::Set

Inherits:
UseCase show all
Defined in:
lib/usecase/set.rb

Overview

The set use case is the generic tool for setting configuration directives inside the safe workstation INI formatted file.

The mirror of this use case is unset.

Observable Value

The configuration directive will eithe be created (or will overwrite) an existing directive with the same path.

The configuration file is printed to inform the user of the current state.

Alternative / Error Flows

Error - if the directive path is not composed of two (fwd slash separated) parts Error - if the directive path and/or value contains (or not) unacceptable characters

Constant Summary

Constants inherited from UseCase

UseCase::APP_DIR_NAME, UseCase::COMMANDMENT, UseCase::ENV_VAR_KEY_NAME, UseCase::ENV_VAR_PREFIX_A, UseCase::ENV_VAR_PREFIX_B, UseCase::FILE_CONTENT_KEY, UseCase::FILE_KEY_PREFIX, UseCase::FILE_NAME_KEY

Instance Attribute Summary collapse

Attributes inherited from UseCase

#from_script

Instance Method Summary collapse

Methods inherited from UseCase

#check_post_conditions, #check_pre_conditions, #cleanup, #config_directory, #config_file, #flow_of_events, #get_master_database, #initialize, #post_validation

Constructor Details

This class inherits a constructor from SafeDb::UseCase

Instance Attribute Details

#domain_name=(value) ⇒ Object (writeonly)

Sets the attribute domain_name

Parameters:

  • value

    the value to set the attribute domain_name to.



24
25
26
# File 'lib/usecase/set.rb', line 24

def domain_name=(value)
  @domain_name = value
end

Instance Method Details

#executeObject

The use use case is borrowed from the database world and it denotes the domain to be used for now (and evermore) for this workstation until another use command is issued.

The parameter domain_name must be set after an object instance is acquired but before the execute method runs.



33
34
# File 'lib/usecase/set.rb', line 33

def execute
end

#pre_validationObject



37
38
# File 'lib/usecase/set.rb', line 37

def pre_validation
end