Class: Avromatic::Model::Configuration
- Inherits:
-
Object
- Object
- Avromatic::Model::Configuration
- Defined in:
- lib/avromatic/model/configuration.rb
Overview
This class holds configuration for a model built from Avro schema(s).
Instance Attribute Summary collapse
-
#avro_schema ⇒ Object
(also: #value_avro_schema)
readonly
Returns the value of attribute avro_schema.
-
#key_avro_schema ⇒ Object
readonly
Returns the value of attribute key_avro_schema.
Instance Method Summary collapse
-
#initialize(**options) ⇒ Configuration
constructor
Either schema(_name) or value_schema(_name), but not both, must be specified.
Constructor Details
#initialize(**options) ⇒ Configuration
Either schema(_name) or value_schema(_name), but not both, must be specified.
20 21 22 23 24 |
# File 'lib/avromatic/model/configuration.rb', line 20 def initialize(**) @avro_schema = find_avro_schema(**) raise ArgumentError.new('value_schema(_name) or schema(_name) must be specified') unless avro_schema @key_avro_schema = find_schema_by_option(:key_schema, **) end |
Instance Attribute Details
#avro_schema ⇒ Object (readonly) Also known as: value_avro_schema
Returns the value of attribute avro_schema.
7 8 9 |
# File 'lib/avromatic/model/configuration.rb', line 7 def avro_schema @avro_schema end |
#key_avro_schema ⇒ Object (readonly)
Returns the value of attribute key_avro_schema.
7 8 9 |
# File 'lib/avromatic/model/configuration.rb', line 7 def key_avro_schema @key_avro_schema end |