Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AVRO-3722 [ruby] Eagerly Initialize Instance Variables in Ruby Implementation #2132

Merged
merged 1 commit into from
Mar 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lang/ruby/lib/avro/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ def self.validate(expected_schema, logical_datum, options = DEFAULT_VALIDATE_OPT
def initialize(type, logical_type=nil)
@type_sym = type.is_a?(Symbol) ? type : type.to_sym
@logical_type = logical_type
@type_adapter = nil
end

attr_reader :type_sym
Expand Down Expand Up @@ -571,6 +572,7 @@ def initialize(type, name, default=:no_default, order=nil, names=nil, namespace=
@order = order
@doc = doc
@aliases = aliases
@type_adapter = nil
validate_aliases! if aliases
validate_default! if default? && !Avro.disable_field_default_validation
end
Expand Down