Class: Configuration
- Inherits:
-
Object
- Object
- Configuration
- Defined in:
- lib/lockr/config.rb
Constant Summary collapse
- CONFIG_FILE =
'.lockr'
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
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.("~/#{CONFIG_FILE}") if File.exists?( filename) File.open( filename, 'r') do |f| @config = YAML::load(f) end end end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
3 4 5 |
# File 'lib/lockr/config.rb', line 3 def config @config end |