class StackMaster::SparkleFormation::CompileTime::StringValidator

Public Class Methods

new(name, definition, parameter) click to toggle source
# File lib/stack_master/sparkle_formation/compile_time/string_validator.rb, line 8
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/string_validator.rb, line 16
def check_is_valid
  return true unless @definition[:type] == :string
  invalid_values.empty?
end
create_error() click to toggle source
# File lib/stack_master/sparkle_formation/compile_time/string_validator.rb, line 26
def create_error
  "#{@name}:#{invalid_values} are not Strings"
end
invalid_values() click to toggle source
# File lib/stack_master/sparkle_formation/compile_time/string_validator.rb, line 21
def invalid_values
  values = build_values(@definition, @parameter)
  values.reject { |value| value.is_a?(String)}
end