Class: JsonSchemaView::Configuration
- Inherits:
-
Object
- Object
- JsonSchemaView::Configuration
- 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
-
#schema_sets ⇒ SchemaSetDictionary{Symbol => Symbol}
The renderers.
-
#validate_by_default ⇒ Boolean
Whether if validate components with its schema on render by default.
Class Method Summary collapse
Instance Method Summary collapse
- #configure {|configuration| ... } ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
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_sets ⇒ SchemaSetDictionary{Symbol => Symbol}
Returns The renderers.
28 29 30 |
# File 'lib/json_schema_view/configuration.rb', line 28 def schema_sets @schema_sets end |
#validate_by_default ⇒ Boolean
Returns 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
17 18 19 |
# File 'lib/json_schema_view/configuration.rb', line 17 def configure(&block) instance.configure(&block) end |
.instance ⇒ JsonSchemaView::Configuration
11 12 13 |
# File 'lib/json_schema_view/configuration.rb', line 11 def instance @instance ||= new end |
Instance Method Details
#configure {|configuration| ... } ⇒ Object
40 41 42 |
# File 'lib/json_schema_view/configuration.rb', line 40 def configure yield self end |