Class: EasyTalk::Configuration
- Inherits:
-
Object
- Object
- EasyTalk::Configuration
- 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_validations ⇒ Object
Returns the value of attribute auto_validations.
-
#default_additional_properties ⇒ Object
Returns the value of attribute default_additional_properties.
-
#nilable_is_optional ⇒ Object
Returns the value of attribute nilable_is_optional.
-
#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.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
-
#schema_uri ⇒ Object
Returns the URI for the configured schema version, or nil if :none.
Constructor Details
#initialize ⇒ Configuration
17 18 19 20 21 22 23 24 |
# File 'lib/easy_talk/configuration.rb', line 17 def initialize @default_additional_properties = false @nilable_is_optional = false @auto_validations = true @schema_version = :none @schema_id = nil @use_refs = false end |
Instance Attribute Details
#auto_validations ⇒ Object
Returns the value of attribute auto_validations.
14 15 16 |
# File 'lib/easy_talk/configuration.rb', line 14 def auto_validations @auto_validations end |
#default_additional_properties ⇒ Object
Returns the value of attribute default_additional_properties.
14 15 16 |
# File 'lib/easy_talk/configuration.rb', line 14 def default_additional_properties @default_additional_properties end |
#nilable_is_optional ⇒ Object
Returns the value of attribute nilable_is_optional.
14 15 16 |
# File 'lib/easy_talk/configuration.rb', line 14 def nilable_is_optional @nilable_is_optional end |
#schema_id ⇒ Object
Returns the value of attribute schema_id.
14 15 16 |
# File 'lib/easy_talk/configuration.rb', line 14 def schema_id @schema_id end |
#schema_version ⇒ Object
Returns the value of attribute schema_version.
14 15 16 |
# File 'lib/easy_talk/configuration.rb', line 14 def schema_version @schema_version end |
#use_refs ⇒ Object
Returns the value of attribute use_refs.
14 15 16 |
# File 'lib/easy_talk/configuration.rb', line 14 def use_refs @use_refs end |
Instance Method Details
#schema_uri ⇒ Object
Returns the URI for the configured schema version, or nil if :none
27 28 29 30 31 |
# File 'lib/easy_talk/configuration.rb', line 27 def schema_uri return nil if @schema_version == :none SCHEMA_VERSIONS[@schema_version] || @schema_version.to_s end |