class StackMaster::SparkleFormation::CompileTime::DefinitionsValidator

Constants

VALID_TYPES

Public Class Methods

new(definitions) click to toggle source
# File lib/stack_master/sparkle_formation/compile_time/definitions_validator.rb, line 9
def initialize(definitions)
  @definitions = definitions
end

Public Instance Methods

validate() click to toggle source
# 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

Private Instance Methods

create_error(name, type) click to toggle source
# File lib/stack_master/sparkle_formation/compile_time/definitions_validator.rb, line 26
def create_error(name, type)
  "#{name}:#{type} valid types are #{VALID_TYPES}"
end
is_valid(type) click to toggle source
# File lib/stack_master/sparkle_formation/compile_time/definitions_validator.rb, line 22
def is_valid(type)
  VALID_TYPES.include? type
end