Class: JSONSchemer::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base_uri: URI('json-schemer://schema'), meta_schema: Draft202012::BASE_URI.to_s, vocabulary: nil, format: true, formats: {}, content_encodings: {}, content_media_types: {}, keywords: {}, before_property_validation: [], after_property_validation: [], insert_property_defaults: false, property_default_resolver: nil, ref_resolver: proc { |uri| raise UnknownRef, uri.to_s }, regexp_resolver: 'ruby', output_format: 'classic', resolve_enumerators: false, access_mode: nil) ⇒ Configuration

Returns a new instance of Configuration.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/json_schemer/configuration.rb', line 9

def initialize(
  base_uri: URI('json-schemer://schema'),
  meta_schema: Draft202012::BASE_URI.to_s,
  vocabulary: nil,
  format: true,
  formats: {},
  content_encodings: {},
  content_media_types: {},
  keywords: {},
  before_property_validation: [],
  after_property_validation: [],
  insert_property_defaults: false,
  property_default_resolver: nil,
  ref_resolver: proc { |uri| raise UnknownRef, uri.to_s },
  regexp_resolver: 'ruby',
  output_format: 'classic',
  resolve_enumerators: false,
  access_mode: nil
)
  super
end

Instance Attribute Details

#access_modeObject

Returns the value of attribute access_mode

Returns:

  • (Object)

    the current value of access_mode



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

def access_mode
  @access_mode
end

#after_property_validationObject

Returns the value of attribute after_property_validation

Returns:

  • (Object)

    the current value of after_property_validation



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

def after_property_validation
  @after_property_validation
end

#base_uriObject

Returns the value of attribute base_uri

Returns:

  • (Object)

    the current value of base_uri



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

def base_uri
  @base_uri
end

#before_property_validationObject

Returns the value of attribute before_property_validation

Returns:

  • (Object)

    the current value of before_property_validation



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

def before_property_validation
  @before_property_validation
end

#content_encodingsObject

Returns the value of attribute content_encodings

Returns:

  • (Object)

    the current value of content_encodings



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

def content_encodings
  @content_encodings
end

#content_media_typesObject

Returns the value of attribute content_media_types

Returns:

  • (Object)

    the current value of content_media_types



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

def content_media_types
  @content_media_types
end

#formatObject

Returns the value of attribute format

Returns:

  • (Object)

    the current value of format



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

def format
  @format
end

#formatsObject

Returns the value of attribute formats

Returns:

  • (Object)

    the current value of formats



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

def formats
  @formats
end

#insert_property_defaultsObject

Returns the value of attribute insert_property_defaults

Returns:

  • (Object)

    the current value of insert_property_defaults



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

def insert_property_defaults
  @insert_property_defaults
end

#keywordsObject

Returns the value of attribute keywords

Returns:

  • (Object)

    the current value of keywords



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

def keywords
  @keywords
end

#meta_schemaObject

Returns the value of attribute meta_schema

Returns:

  • (Object)

    the current value of meta_schema



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

def meta_schema
  @meta_schema
end

#output_formatObject

Returns the value of attribute output_format

Returns:

  • (Object)

    the current value of output_format



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

def output_format
  @output_format
end

#property_default_resolverObject

Returns the value of attribute property_default_resolver

Returns:

  • (Object)

    the current value of property_default_resolver



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

def property_default_resolver
  @property_default_resolver
end

#ref_resolverObject

Returns the value of attribute ref_resolver

Returns:

  • (Object)

    the current value of ref_resolver



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

def ref_resolver
  @ref_resolver
end

#regexp_resolverObject

Returns the value of attribute regexp_resolver

Returns:

  • (Object)

    the current value of regexp_resolver



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

def regexp_resolver
  @regexp_resolver
end

#resolve_enumeratorsObject

Returns the value of attribute resolve_enumerators

Returns:

  • (Object)

    the current value of resolve_enumerators



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

def resolve_enumerators
  @resolve_enumerators
end

#vocabularyObject

Returns the value of attribute vocabulary

Returns:

  • (Object)

    the current value of vocabulary



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

def vocabulary
  @vocabulary
end