Class: DPN::Bagit::Settings

Inherits:
Object
  • Object
show all
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

Constructor Details

#initializeSettings

Returns a new instance of Settings.



10
11
12
13
# File 'lib/dpn/bagit/settings.rb', line 10

def initialize
  @config = nil
  config
end

Instance Method Details

#[](key) ⇒ Object



26
27
28
# File 'lib/dpn/bagit/settings.rb', line 26

def [](key)
  config[key]
end

#[]=(key, value) ⇒ Object



30
31
32
# File 'lib/dpn/bagit/settings.rb', line 30

def []=(key,value)
  config[key] = value
end

#configObject



16
17
18
19
20
21
22
23
24
# File 'lib/dpn/bagit/settings.rb', line 16

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