Class: DInstaller::InstallationPhase
- Inherits:
-
Object
- Object
- DInstaller::InstallationPhase
- Defined in:
- lib/dinstaller/installation_phase.rb
Overview
Represents the installation phase of the manager service and allows to configure callbacks to be called when the installation phase value changes
Constant Summary collapse
- STARTUP =
Possible installation phase values
"startup"- CONFIG =
"config"- INSTALL =
"install"
Instance Method Summary collapse
-
#config ⇒ self
Sets the installation phase value to config.
-
#config? ⇒ Boolean
Whether the current installation phase value is config.
-
#initialize ⇒ InstallationPhase
constructor
A new instance of InstallationPhase.
-
#install ⇒ self
Sets the installation phase value to install.
-
#install? ⇒ Boolean
Whether the current installation phase value is install.
-
#on_change(&block) ⇒ Object
Registers callbacks to be called when the installation phase value changes.
-
#startup ⇒ self
Sets the installation phase value to startup.
-
#startup? ⇒ Boolean
Whether the current installation phase value is startup.
Constructor Details
#initialize ⇒ InstallationPhase
Returns a new instance of InstallationPhase.
31 32 33 |
# File 'lib/dinstaller/installation_phase.rb', line 31 def initialize @on_change_callbacks = [] end |
Instance Method Details
#config ⇒ self
Callbacks are called.
Sets the installation phase value to config
71 72 73 74 |
# File 'lib/dinstaller/installation_phase.rb', line 71 def config change_to(CONFIG) self end |
#config? ⇒ Boolean
Whether the current installation phase value is config
45 46 47 |
# File 'lib/dinstaller/installation_phase.rb', line 45 def config? value == CONFIG end |
#install ⇒ self
Callbacks are called.
Sets the installation phase value to install
81 82 83 84 |
# File 'lib/dinstaller/installation_phase.rb', line 81 def install change_to(INSTALL) self end |
#install? ⇒ Boolean
Whether the current installation phase value is install
52 53 54 |
# File 'lib/dinstaller/installation_phase.rb', line 52 def install? value == INSTALL end |
#on_change(&block) ⇒ Object
Registers callbacks to be called when the installation phase value changes
89 90 91 |
# File 'lib/dinstaller/installation_phase.rb', line 89 def on_change(&block) @on_change_callbacks << block end |
#startup ⇒ self
Callbacks are called.
Sets the installation phase value to startup
61 62 63 64 |
# File 'lib/dinstaller/installation_phase.rb', line 61 def startup change_to(STARTUP) self end |
#startup? ⇒ Boolean
Whether the current installation phase value is startup
38 39 40 |
# File 'lib/dinstaller/installation_phase.rb', line 38 def startup? value == STARTUP end |