Class: Schemacop::Schema3
- Inherits:
-
BaseSchema
- Object
- BaseSchema
- Schemacop::Schema3
- Defined in:
- lib/schemacop/schema3.rb
Instance Attribute Summary
Attributes inherited from BaseSchema
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(*args, **kwargs, &block) ⇒ Schema3
constructor
A new instance of Schema3.
-
#validate(data) ⇒ Schemacop::Collector
Validate data for the defined Schema.
Methods inherited from BaseSchema
#invalid?, #valid?, #validate!
Constructor Details
#initialize(*args, **kwargs, &block) ⇒ Schema3
Returns a new instance of Schema3.
3 4 5 6 |
# File 'lib/schemacop/schema3.rb', line 3 def initialize(*args, **kwargs, &block) super() @root = V3::Node.create(*args, **kwargs, &block) end |
Instance Method Details
#as_json ⇒ Object
17 18 19 |
# File 'lib/schemacop/schema3.rb', line 17 def as_json root.as_json end |
#validate(data) ⇒ Schemacop::Collector
Validate data for the defined Schema
13 14 15 |
# File 'lib/schemacop/schema3.rb', line 13 def validate(data) root.validate(data) end |