Class: EasyTalk::Configuration
- Inherits:
-
Object
- Object
- EasyTalk::Configuration
- Extended by:
- T::Sig
- Defined in:
- lib/easy_talk/configuration.rb
Constant Summary collapse
- SCHEMA_VERSIONS =
JSON Schema draft version URIs
{ draft202012: 'https://json-schema.org/draft/2020-12/schema', draft201909: 'https://json-schema.org/draft/2019-09/schema', draft7: 'http://json-schema.org/draft-07/schema#', draft6: 'http://json-schema.org/draft-06/schema#', draft4: 'http://json-schema.org/draft-04/schema#' }.freeze
Instance Attribute Summary collapse
-
#auto_generate_ids ⇒ Object
Returns the value of attribute auto_generate_ids.
-
#auto_validations ⇒ Object
Returns the value of attribute auto_validations.
-
#base_schema_uri ⇒ Object
Returns the value of attribute base_schema_uri.
-
#default_additional_properties ⇒ Object
Returns the value of attribute default_additional_properties.
-
#default_error_format ⇒ Object
Returns the value of attribute default_error_format.
-
#error_type_base_uri ⇒ Object
Returns the value of attribute error_type_base_uri.
-
#include_error_codes ⇒ Object
Returns the value of attribute include_error_codes.
-
#nilable_is_optional ⇒ Object
Returns the value of attribute nilable_is_optional.
-
#prefer_external_refs ⇒ Object
Returns the value of attribute prefer_external_refs.
-
#property_naming_strategy ⇒ Object
Returns the value of attribute property_naming_strategy.
-
#schema_id ⇒ Object
Returns the value of attribute schema_id.
-
#schema_version ⇒ Object
Returns the value of attribute schema_version.
-
#use_refs ⇒ Object
Returns the value of attribute use_refs.
-
#validation_adapter ⇒ Object
Returns the value of attribute validation_adapter.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #register_type(type_key, builder_class, collection: false) ⇒ Object
- #schema_uri ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/easy_talk/configuration.rb', line 25 def initialize @default_additional_properties = false @nilable_is_optional = false @auto_validations = true @validation_adapter = :active_model @schema_version = :none @schema_id = nil @use_refs = false @default_error_format = :flat @error_type_base_uri = 'about:blank' @include_error_codes = true @base_schema_uri = nil @auto_generate_ids = false @prefer_external_refs = false self.property_naming_strategy = :identity end |
Instance Attribute Details
#auto_generate_ids ⇒ Object
Returns the value of attribute auto_generate_ids.
19 20 21 |
# File 'lib/easy_talk/configuration.rb', line 19 def auto_generate_ids @auto_generate_ids end |
#auto_validations ⇒ Object
Returns the value of attribute auto_validations.
19 20 21 |
# File 'lib/easy_talk/configuration.rb', line 19 def auto_validations @auto_validations end |
#base_schema_uri ⇒ Object
Returns the value of attribute base_schema_uri.
19 20 21 |
# File 'lib/easy_talk/configuration.rb', line 19 def base_schema_uri @base_schema_uri end |
#default_additional_properties ⇒ Object
Returns the value of attribute default_additional_properties.
19 20 21 |
# File 'lib/easy_talk/configuration.rb', line 19 def default_additional_properties @default_additional_properties end |
#default_error_format ⇒ Object
Returns the value of attribute default_error_format.
19 20 21 |
# File 'lib/easy_talk/configuration.rb', line 19 def default_error_format @default_error_format end |
#error_type_base_uri ⇒ Object
Returns the value of attribute error_type_base_uri.
19 20 21 |
# File 'lib/easy_talk/configuration.rb', line 19 def error_type_base_uri @error_type_base_uri end |
#include_error_codes ⇒ Object
Returns the value of attribute include_error_codes.
19 20 21 |
# File 'lib/easy_talk/configuration.rb', line 19 def include_error_codes @include_error_codes end |
#nilable_is_optional ⇒ Object
Returns the value of attribute nilable_is_optional.
19 20 21 |
# File 'lib/easy_talk/configuration.rb', line 19 def nilable_is_optional @nilable_is_optional end |
#prefer_external_refs ⇒ Object
Returns the value of attribute prefer_external_refs.
19 20 21 |
# File 'lib/easy_talk/configuration.rb', line 19 def prefer_external_refs @prefer_external_refs end |
#property_naming_strategy ⇒ Object
Returns the value of attribute property_naming_strategy.
22 23 24 |
# File 'lib/easy_talk/configuration.rb', line 22 def property_naming_strategy @property_naming_strategy end |
#schema_id ⇒ Object
Returns the value of attribute schema_id.
19 20 21 |
# File 'lib/easy_talk/configuration.rb', line 19 def schema_id @schema_id end |
#schema_version ⇒ Object
Returns the value of attribute schema_version.
19 20 21 |
# File 'lib/easy_talk/configuration.rb', line 19 def schema_version @schema_version end |
#use_refs ⇒ Object
Returns the value of attribute use_refs.
19 20 21 |
# File 'lib/easy_talk/configuration.rb', line 19 def use_refs @use_refs end |
#validation_adapter ⇒ Object
Returns the value of attribute validation_adapter.
19 20 21 |
# File 'lib/easy_talk/configuration.rb', line 19 def validation_adapter @validation_adapter end |
Instance Method Details
#register_type(type_key, builder_class, collection: false) ⇒ Object
70 71 72 |
# File 'lib/easy_talk/configuration.rb', line 70 def register_type(type_key, builder_class, collection: false) EasyTalk::Builders::Registry.register(type_key, builder_class, collection: collection) end |
#schema_uri ⇒ Object
44 45 46 47 48 |
# File 'lib/easy_talk/configuration.rb', line 44 def schema_uri return nil if @schema_version == :none SCHEMA_VERSIONS[@schema_version] || @schema_version.to_s end |