Class: ConfCtl::ModuleOptions
- Inherits:
-
Object
- Object
- ConfCtl::ModuleOptions
- Defined in:
- lib/confctl/module_options.rb
Defined Under Namespace
Classes: Option
Instance Attribute Summary collapse
Instance Method Summary collapse
- #confctl_settings ⇒ Object
-
#initialize(nix: nil) ⇒ ModuleOptions
constructor
A new instance of ModuleOptions.
- #machine_settings ⇒ Object
- #read ⇒ Object
- #service_settings ⇒ Object
- #swpin_settings ⇒ Object
Constructor Details
#initialize(nix: nil) ⇒ ModuleOptions
Returns a new instance of ModuleOptions.
61 62 63 64 |
# File 'lib/confctl/module_options.rb', line 61 def initialize(nix: nil) @nix = nix || Nix.new @options = [] end |
Instance Attribute Details
#options ⇒ Array<ModuleOptions::Option> (readonly)
58 59 60 |
# File 'lib/confctl/module_options.rb', line 58 def @options end |
Instance Method Details
#confctl_settings ⇒ Object
72 73 74 75 76 77 |
# File 'lib/confctl/module_options.rb', line 72 def confctl_settings .select do |opt| opt.name.start_with?('confctl.') \ && !opt.name.start_with?('confctl.swpins.') end end |
#machine_settings ⇒ Object
83 84 85 |
# File 'lib/confctl/module_options.rb', line 83 def machine_settings .select { |opt| opt.name.start_with?('cluster.') } end |
#read ⇒ Object
66 67 68 69 70 |
# File 'lib/confctl/module_options.rb', line 66 def read @options = nix..map do |opt| Option.new(opt) end end |
#service_settings ⇒ Object
87 88 89 |
# File 'lib/confctl/module_options.rb', line 87 def service_settings .select { |opt| opt.name.start_with?('services.') } end |
#swpin_settings ⇒ Object
79 80 81 |
# File 'lib/confctl/module_options.rb', line 79 def swpin_settings .select { |opt| opt.name.start_with?('confctl.swpins.') } end |