Class: CandyCheck::Utils::Config
- Inherits:
-
Object
- Object
- CandyCheck::Utils::Config
- Defined in:
- lib/candy_check/utils/config.rb
Overview
Very basic base implementation to store and validate a configuration
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Config
constructor
Initializes a new configuration from a hash.
Constructor Details
#initialize(attributes) ⇒ Config
Initializes a new configuration from a 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 |