Class: Stylegen::Validator

Inherits:
Object
  • Object
show all
Defined in:
lib/stylegen/validator.rb

Instance Method Summary collapse

Instance Method Details

#valid?(config) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/stylegen/validator.rb', line 7

def valid?(config)
  schema.valid?(config)
end

#validate(config) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/stylegen/validator.rb', line 11

def validate(config)
  errors = []

  schema.validate(config).each do |v|
    errors << JSONSchemer::Errors.pretty(v) unless v['type'] == 'schema'
  end

  errors
end