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

#custom_formatsObject (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_withObject

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