Class: JsonSchema::Configuration
- Inherits:
-
Object
- Object
- JsonSchema::Configuration
- Defined in:
- lib/json_schema/configuration.rb
Instance Attribute Summary collapse
-
#custom_formats ⇒ Object
readonly
Returns the value of attribute custom_formats.
-
#validate_regex_with ⇒ Object
Returns the value of attribute validate_regex_with.
Instance Method Summary collapse
- #register_format(name, validator_proc) ⇒ Object
-
#reset! ⇒ Object
Used for testing.
Instance Attribute Details
#custom_formats ⇒ Object (readonly)
Returns the value of attribute custom_formats.
3 4 5 |
# File 'lib/json_schema/configuration.rb', line 3 def custom_formats @custom_formats end |
#validate_regex_with ⇒ Object
Returns the value of attribute validate_regex_with.
4 5 6 |
# File 'lib/json_schema/configuration.rb', line 4 def validate_regex_with @validate_regex_with end |
Instance Method Details
#register_format(name, validator_proc) ⇒ Object
10 11 12 |
# File 'lib/json_schema/configuration.rb', line 10 def register_format(name, validator_proc) @custom_formats[name] = validator_proc end |
#reset! ⇒ Object
Used for testing.
15 16 17 18 |
# File 'lib/json_schema/configuration.rb', line 15 def reset! @validate_regex_with = nil @custom_formats = {} end |