class SteamPath

Represents a path to the Steam installation.

Attributes

config_path[R]

Public Class Methods

new() click to toggle source
# File lib/fix-steam-font/steam_path.rb, line 7
def initialize
  @path = nil
  @config_path = File.join File.expand_path('~'), 'fix-steam-font.yaml'
end

Public Instance Methods

empty?() click to toggle source
# File lib/fix-steam-font/steam_path.rb, line 16
def empty?
  @path.to_s.empty?
end
exists?() click to toggle source
# File lib/fix-steam-font/steam_path.rb, line 20
def exists?
  File.exists? @path
end
load() click to toggle source

Load path from configuration file.

# File lib/fix-steam-font/steam_path.rb, line 25
def load
  config = YAML.load_file @config_path
  @path = config['steam']
end
save(path) click to toggle source
# File lib/fix-steam-font/steam_path.rb, line 30
def save(path)
  @path = path
  File.open(@config_path, 'w') {|file| file << "steam: #{@path}"}
end
to_s() click to toggle source
# File lib/fix-steam-font/steam_path.rb, line 12
def to_s
  @path.to_s
end