Class: JsonSchemaView::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/json_schema_view/configuration.rb,
lib/json_schema_view/configuration/schema_set_dictionary.rb

Overview

The singleton holds the configuration for the gem. it can be accessed by both its class methods and Rails’s configuration.

Defined Under Namespace

Classes: SchemaSetDictionary

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



22
23
24
25
# File 'lib/json_schema_view/configuration.rb', line 22

def initialize
  @schema_sets = SchemaSetDictionary.new
  @validate_by_default = false
end

Instance Attribute Details

#schema_setsSchemaSetDictionary{Symbol => Symbol}

Returns The renderers.

Returns:



28
29
30
# File 'lib/json_schema_view/configuration.rb', line 28

def schema_sets
  @schema_sets
end

#validate_by_defaultBoolean

Returns Whether if validate components with its schema on render by default.

Returns:

  • (Boolean)

    Whether if validate components with its schema on render by default.



31
32
33
# File 'lib/json_schema_view/configuration.rb', line 31

def validate_by_default
  @validate_by_default
end

Class Method Details

.configure {|configuration| ... } ⇒ Object

Yields:

Yield Parameters:



17
18
19
# File 'lib/json_schema_view/configuration.rb', line 17

def configure(&block)
  instance.configure(&block)
end

.instanceJsonSchemaView::Configuration



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

def instance
  @instance ||= new
end

Instance Method Details

#configure {|configuration| ... } ⇒ Object

Yields:

Yield Parameters:



40
41
42
# File 'lib/json_schema_view/configuration.rb', line 40

def configure
  yield self
end