Class: Hobostove::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/hobostove/configuration.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.current_roomObject

Returns the value of attribute current_room.



6
7
8
# File 'lib/hobostove/configuration.rb', line 6

def current_room
  @current_room
end

Class Method Details

.configObject



12
13
14
# File 'lib/hobostove/configuration.rb', line 12

def config
  @config ||= YAML.load(File.open(config_file))[current_room]
end

.config_fileObject



16
17
18
19
# File 'lib/hobostove/configuration.rb', line 16

def config_file
  user = Etc.getlogin
  File.join(Dir.home(user), ".hobostove.yml")
end

.log_fileObject



21
22
23
24
# File 'lib/hobostove/configuration.rb', line 21

def log_file
  user = Etc.getlogin
  File.join(Dir.home(user), ".hobostove.log")
end

.method_missing(method) ⇒ Object



8
9
10
# File 'lib/hobostove/configuration.rb', line 8

def method_missing(method)
  config[method.to_s]
end