Class: OAI::Harvester::Config

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/oai/harvester/config.rb

Constant Summary collapse

PERIODS =
%w(daily weekly monthly)
GLOBAL =
"/etc/oai/harvester.yml"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.loadObject



15
16
17
18
# File 'lib/oai/harvester/config.rb', line 15

def self.load
  config = find_config
  File.exists?(config) ? new(YAML.load_file(config)) : new
end

Instance Method Details

#saveObject



20
21
22
23
24
25
# File 'lib/oai/harvester/config.rb', line 20

def save
  config = Config.find_config
  open(config, 'w') do |out|
    YAML.dump(@table, out)
  end
end