# class Puppet::Util::RunMode

### Attributes

name[R]

### Public Class Methods

[](name) click to toggle source

    # File lib/puppet/util/run_mode.rb, line 12
    def self.[](name)
      @run_modes ||= {}
      if Puppet.features.microsoft_windows?
        @run_modes[name] ||= WindowsRunMode.new(name)
      else
        @run_modes[name] ||= UnixRunMode.new(name)
      end
    end

new(name) click to toggle source

    # File lib/puppet/util/run_mode.rb, line 6
    def initialize(name)
      @name = name.to_sym
    end

### Public Instance Methods

agent?() click to toggle source

    # File lib/puppet/util/run_mode.rb, line 25
    def agent?
      name == :agent
    end

log_dir() click to toggle source

    # File lib/puppet/util/run_mode.rb, line 37
    def log_dir
      "$vardir/log"
    end

master?() click to toggle source

    # File lib/puppet/util/run_mode.rb, line 21
    def master?
      name == :master
    end

run_dir() click to toggle source

    # File lib/puppet/util/run_mode.rb, line 33
    def run_dir
      "$vardir/run"
    end

user?() click to toggle source

    # File lib/puppet/util/run_mode.rb, line 29
    def user?
      name == :user
    end