Class: CandyCheck::Utils::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/candy_check/utils/config.rb

Overview

Very basic base implementation to store and validate a configuration

Direct Known Subclasses

AppStore::Config

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ Config

Initializes a new configuration from a hash

Parameters:

  • attributes (Hash)


7
8
9
10
11
12
13
14
# File 'lib/candy_check/utils/config.rb', line 7

def initialize(attributes)
  if attributes.is_a?(Hash)
    attributes.each do |k, v|
      instance_variable_set "@#{k}", v
    end
  end
  validate!
end