Class: Nginxtra::Status
- Inherits:
-
Object
- Object
- Nginxtra::Status
- Defined in:
- lib/nginxtra/status.rb
Overview
The status class encapsulates current state of nginxtra, such as when the last time nginx was compiled and with what options.
Constant Summary collapse
- FILENAME =
The name of the file that stores the state.
".nginxtra_status".freeze
- @@status =
nil
Class Method Summary collapse
-
.[](option) ⇒ Object
Retrieve an option from the state stored in the filesystem.
-
.[]=(option, value) ⇒ Object
Store an option to the status state.
Class Method Details
.[](option) ⇒ Object
Retrieve an option from the state stored in the filesystem. This will first load the state from the .nginxtra_status file in the root of the nginxtra gem directory, if it has not yet been loaded.
16 17 18 19 |
# File 'lib/nginxtra/status.rb', line 16 def[](option) load! @@status[option] end |
.[]=(option, value) ⇒ Object
Store an option to the status state. This will save out to the filesystem immediately after storing this option. The return value will be the value stored to the given option key.
24 25 26 27 28 29 |
# File 'lib/nginxtra/status.rb', line 24 def[]=(option, value) load! @@status[option] = value save! value end |