Class: CHBuild::Config::Use
- Inherits:
-
Hash
- Object
- Hash
- CHBuild::Config::Use
- Defined in:
- lib/chbuild/config/use.rb
Overview
Use section
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
-
#initialize(using = {}) ⇒ Use
constructor
A new instance of Use.
- #name ⇒ Object
- #validate!(using) ⇒ Object
Constructor Details
#initialize(using = {}) ⇒ Use
Returns a new instance of Use.
16 17 18 19 20 21 22 23 |
# File 'lib/chbuild/config/use.rb', line 16 def initialize(using = {}) super replace(DEFAULTS) validate!(using) merge!(using) unless using.nil? end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
35 36 37 |
# File 'lib/chbuild/config/use.rb', line 35 def errors @errors end |
Instance Method Details
#name ⇒ Object
37 38 39 |
# File 'lib/chbuild/config/use.rb', line 37 def name "Section 'use'" end |
#validate!(using) ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/chbuild/config/use.rb', line 25 def validate!(using) @errors = [] if using.respond_to? :keys extra_keys = using.keys - ALLOWED_VALUES extra_keys.each do |key| @errors << "Unknown key: #{key}" end end end |