Class: StackMaster::SparkleFormation::CompileTime::DefinitionsValidator
- Inherits:
-
Object
- Object
- StackMaster::SparkleFormation::CompileTime::DefinitionsValidator
- Defined in:
- lib/stack_master/sparkle_formation/compile_time/definitions_validator.rb
Constant Summary collapse
- VALID_TYPES =
[:string, :number]
Instance Method Summary collapse
-
#initialize(definitions) ⇒ DefinitionsValidator
constructor
A new instance of DefinitionsValidator.
- #validate ⇒ Object
Constructor Details
#initialize(definitions) ⇒ DefinitionsValidator
Returns a new instance of DefinitionsValidator.
9 10 11 |
# File 'lib/stack_master/sparkle_formation/compile_time/definitions_validator.rb', line 9 def initialize(definitions) @definitions = definitions end |
Instance Method Details
#validate ⇒ Object
13 14 15 16 17 18 |
# File 'lib/stack_master/sparkle_formation/compile_time/definitions_validator.rb', line 13 def validate @definitions.each do|name, definition| type = definition[:type] raise ArgumentError.new "Unknown compile time parameter type: #{create_error(name, type)}" unless is_valid(type) end end |