class Vnstat::Configuration

A class encapsulating configurations of the Vnstat environment.

@!attribute executable_path

@return The location of the vnstat executable.

Attributes

executable_path[W]

Public Class Methods

new() click to toggle source

Initializes the {Configuration}.

# File lib/vnstat/configuration.rb, line 12
def initialize
  reset
end

Public Instance Methods

executable_path() click to toggle source

Returns the location of the vnstat executable.

@return [String]

# File lib/vnstat/configuration.rb, line 29
def executable_path
  @executable_path ||= Utils.system_call('which', 'vnstat') do
    raise ExecutableNotFound, 'Unable to locate vnstat executable'
  end
end
reset() click to toggle source

Restores the configuration defaults.

@return [Configuration]

# File lib/vnstat/configuration.rb, line 20
def reset
  @executable_path = nil
  self
end