Class: DPN::Bagit::Settings
- Inherits:
-
Object
- Object
- DPN::Bagit::Settings
- Includes:
- Singleton
- Defined in:
- lib/dpn/bagit/settings.rb
Overview
A class that manages the various settings required by dpn-bagit.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
- #config ⇒ Object
-
#initialize ⇒ Settings
constructor
A new instance of Settings.
Constructor Details
#initialize ⇒ Settings
Returns a new instance of Settings.
8 9 10 11 |
# File 'lib/dpn/bagit/settings.rb', line 8 def initialize @config = nil config end |
Instance Method Details
#[](key) ⇒ Object
24 25 26 |
# File 'lib/dpn/bagit/settings.rb', line 24 def [](key) config[key] end |
#[]=(key, value) ⇒ Object
28 29 30 |
# File 'lib/dpn/bagit/settings.rb', line 28 def []=(key,value) config[key] = value end |
#config ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/dpn/bagit/settings.rb', line 14 def config if @config == nil @config = Configliere::Param.new @config[:root] = get_project_root @config.read File.join @config[:root], "/lib/dpn/bagit/defaults.config.yml" @config.resolve! end @config end |