Class: Puppet::Util::RunMode Private
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Direct Known Subclasses
Instance Attribute Summary collapse
- #name ⇒ Object readonly private
Class Method Summary collapse
- .[](name) ⇒ Object private
Instance Method Summary collapse
- #agent? ⇒ Boolean private
-
#initialize(name) ⇒ RunMode
constructor
private
A new instance of RunMode.
- #log_dir ⇒ Object private
- #master? ⇒ Boolean private
- #run_dir ⇒ Object private
- #server? ⇒ Boolean private
- #user? ⇒ Boolean private
Constructor Details
#initialize(name) ⇒ RunMode
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of RunMode.
6 7 8 |
# File 'lib/puppet/util/run_mode.rb', line 6 def initialize(name) @name = name.to_sym end |
Instance Attribute Details
#name ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
10 11 12 |
# File 'lib/puppet/util/run_mode.rb', line 10 def name @name end |
Class Method Details
.[](name) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
12 13 14 15 16 17 18 19 |
# File 'lib/puppet/util/run_mode.rb', line 12 def self.[](name) @run_modes ||= {} if Puppet::Util::Platform.windows? @run_modes[name] ||= WindowsRunMode.new(name) else @run_modes[name] ||= UnixRunMode.new(name) end end |
Instance Method Details
#agent? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
29 30 31 |
# File 'lib/puppet/util/run_mode.rb', line 29 def agent? name == :agent end |
#log_dir ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
41 42 43 |
# File 'lib/puppet/util/run_mode.rb', line 41 def log_dir RunMode[name].log_dir end |
#master? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
25 26 27 |
# File 'lib/puppet/util/run_mode.rb', line 25 def master? name == :master || name == :server end |
#run_dir ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
37 38 39 |
# File 'lib/puppet/util/run_mode.rb', line 37 def run_dir RunMode[name].run_dir end |
#server? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
21 22 23 |
# File 'lib/puppet/util/run_mode.rb', line 21 def server? name == :master || name == :server end |
#user? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
33 34 35 |
# File 'lib/puppet/util/run_mode.rb', line 33 def user? name == :user end |