Class: JsonSchema::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/json_schema/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#all_of_sub_errorsObject

Returns the value of attribute all_of_sub_errors


3
4
5
# File 'lib/json_schema/configuration.rb', line 3

def all_of_sub_errors
  @all_of_sub_errors
end

#custom_formatsObject (readonly)

Returns the value of attribute custom_formats


4
5
6
# File 'lib/json_schema/configuration.rb', line 4

def custom_formats
  @custom_formats
end

#validate_regex_withObject

Returns the value of attribute validate_regex_with


5
6
7
# File 'lib/json_schema/configuration.rb', line 5

def validate_regex_with
  @validate_regex_with
end

Instance Method Details

#register_format(name, validator_proc) ⇒ Object


11
12
13
# File 'lib/json_schema/configuration.rb', line 11

def register_format(name, validator_proc)
  @custom_formats[name] = validator_proc
end

#reset!Object

Used for testing.


16
17
18
19
20
# File 'lib/json_schema/configuration.rb', line 16

def reset!
  @validate_regex_with = nil
  @custom_formats = {}
  @all_of_sub_errors = false
end