class StackMaster::SparkleFormation::CompileTime::AllowedPatternValidator
Constants
- KEY
Public Class Methods
new(name, definition, parameter)
click to toggle source
# File lib/stack_master/sparkle_formation/compile_time/allowed_pattern_validator.rb, line 10 def initialize(name, definition, parameter) @name = name @definition = definition @parameter = parameter end
Private Instance Methods
check_is_valid()
click to toggle source
# File lib/stack_master/sparkle_formation/compile_time/allowed_pattern_validator.rb, line 18 def check_is_valid return true unless @definition.key?(KEY) invalid_values.empty? end
create_error()
click to toggle source
# File lib/stack_master/sparkle_formation/compile_time/allowed_pattern_validator.rb, line 28 def create_error "#{@name}:#{invalid_values} does not match #{KEY}:#{@definition[KEY]}" end
invalid_values()
click to toggle source
# File lib/stack_master/sparkle_formation/compile_time/allowed_pattern_validator.rb, line 23 def invalid_values values = build_values(@definition, @parameter) values.reject { |value| value.to_s.match(%r{#{@definition[KEY]}}) } end