class ContainersManager::Configuration

Public Class Methods

check() click to toggle source
# File lib/containers_manager/configuration.rb, line 12
def self.check
  $stdout.puts(@data.inspect)
  $stdout.puts("OK")
end
load(file_path) click to toggle source
# File lib/containers_manager/configuration.rb, line 5
def self.load(file_path)
  raise "#{file_path} cannot be found" unless File.exists?(file_path)

  @file_path = file_path
  @data      = YAML.load_file(file_path)
end

Private Class Methods

method_missing(method_name, *args, &block) click to toggle source
# File lib/containers_manager/configuration.rb, line 19
def self.method_missing(method_name, *args, &block)
  value = @data[method_name.to_s]
  raise "Attribute '#{method_name}' cannot be found in the #{@file_path}" unless value
  value
end