Class: Brio::RCFile

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/brio/rcfile.rb

Constant Summary collapse

FILE_NAME =
".brio.rc"

Instance Method Summary collapse

Constructor Details

#initializeRCFile

Returns a new instance of RCFile.



10
11
12
13
# File 'lib/brio/rcfile.rb', line 10

def initialize
  @path = File.join( ENV['HOME'], FILE_NAME )
  @data = load_data
end

Instance Method Details

#[](param) ⇒ Object



20
21
22
# File 'lib/brio/rcfile.rb', line 20

def [](param)
  config[param]
end

#[]=(param, val) ⇒ Object



15
16
17
18
# File 'lib/brio/rcfile.rb', line 15

def []=(param, val)
  config[param] = val
  save_data
end

#configObject



24
25
26
# File 'lib/brio/rcfile.rb', line 24

def config
  @data['config']
end

#empty?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/brio/rcfile.rb', line 28

def empty?
  @data == default_config
end