Class: SciolyFF::Validator
- Inherits:
-
Object
- Object
- SciolyFF::Validator
- Defined in:
- lib/sciolyff/validator.rb
Overview
Checks if SciolyFF YAML files and/or representations (i.e. hashes that can be directly converted to YAML) comply with spec (i.e. safe for interpreting)
Defined Under Namespace
Modules: Sections Classes: Checker, Events, Logger, Penalties, Placings, Raws, Teams, TopLevel, Tournament
Instance Method Summary collapse
-
#initialize(loglevel = Logger::WARN) ⇒ Validator
constructor
A new instance of Validator.
- #last_log ⇒ Object
- #valid?(rep_or_file) ⇒ Boolean
Constructor Details
Instance Method Details
#last_log ⇒ Object
34 35 36 |
# File 'lib/sciolyff/validator.rb', line 34 def last_log @logger.log end |
#valid?(rep_or_file) ⇒ Boolean
24 25 26 27 28 29 30 31 32 |
# File 'lib/sciolyff/validator.rb', line 24 def valid?(rep_or_file) @logger.flush if rep_or_file.instance_of? String valid_file?(rep_or_file, @logger) else valid_rep?(rep_or_file, @logger) end end |