Class: Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/lockr/config.rb

Constant Summary collapse

CONFIG_FILE =
'.lockr'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



5
6
7
8
9
10
11
12
13
14
# File 'lib/lockr/config.rb', line 5

def initialize()
  @config = nil
  
  filename = File.expand_path("~/#{CONFIG_FILE}")
  if File.exists?( filename)
    File.open( filename, 'r') do |f|
      @config = YAML::load(f)
    end
  end
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



3
4
5
# File 'lib/lockr/config.rb', line 3

def config
  @config
end