Class: JSON::StrictSchemaGenerator
- Inherits:
-
Object
- Object
- JSON::StrictSchemaGenerator
- Defined in:
- lib/json/strict_schema_generator.rb
Instance Attribute Summary collapse
-
#schema ⇒ Object
readonly
Returns the value of attribute schema.
Class Method Summary collapse
-
.call(schema) ⇒ Object
beware that the provided object must have symbol keys and will be modified.
Instance Method Summary collapse
-
#initialize(schema) ⇒ StrictSchemaGenerator
constructor
A new instance of StrictSchemaGenerator.
- #strictify! ⇒ Object
Constructor Details
#initialize(schema) ⇒ StrictSchemaGenerator
Returns a new instance of StrictSchemaGenerator.
10 11 12 |
# File 'lib/json/strict_schema_generator.rb', line 10 def initialize(schema) @schema = schema end |
Instance Attribute Details
#schema ⇒ Object (readonly)
Returns the value of attribute schema.
3 4 5 |
# File 'lib/json/strict_schema_generator.rb', line 3 def schema @schema end |
Class Method Details
.call(schema) ⇒ Object
beware that the provided object must have symbol keys and will be modified
6 7 8 |
# File 'lib/json/strict_schema_generator.rb', line 6 def self.call(schema) new(schema).strictify! end |
Instance Method Details
#strictify! ⇒ Object
14 15 16 17 18 |
# File 'lib/json/strict_schema_generator.rb', line 14 def strictify! set_strict_attributes_for(schema) schema end |