Class: JsonSchema::PowerValidator
- Inherits:
-
Object
- Object
- JsonSchema::PowerValidator
- Defined in:
- lib/json_schema_power_validator.rb
Instance Method Summary collapse
- #get_result ⇒ Object
-
#initialize(schema, suite) ⇒ PowerValidator
constructor
A new instance of PowerValidator.
- #ok? ⇒ Boolean
Constructor Details
#initialize(schema, suite) ⇒ PowerValidator
Returns a new instance of PowerValidator.
7 8 9 10 11 12 13 |
# File 'lib/json_schema_power_validator.rb', line 7 def initialize(schema, suite) @schema = JSON.parse(File.read(schema)) @suites = JSON.parse(File.read(suite)) @raw_results ||= [] @result_json ||= [] @results = validate end |
Instance Method Details
#get_result ⇒ Object
15 16 17 |
# File 'lib/json_schema_power_validator.rb', line 15 def get_result JSON.pretty_generate(@results) end |
#ok? ⇒ Boolean
19 20 21 |
# File 'lib/json_schema_power_validator.rb', line 19 def ok? @raw_results.all? { |result| result == success } end |