Class: Avrolution::CompatibilityCheck

Inherits:
Object
  • Object
show all
Extended by:
PrivateAttr
Defined in:
lib/avrolution/compatibility_check.rb

Constant Summary collapse

NONE =
'NONE'.freeze
FULL =
'FULL'.freeze
BACKWARD =
'BACKWARD'.freeze
FORWARD =
'FORWARD'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(logger: Avrolution.logger) ⇒ CompatibilityCheck

Returns a new instance of CompatibilityCheck.



19
20
21
22
23
24
# File 'lib/avrolution/compatibility_check.rb', line 19

def initialize(logger: Avrolution.logger)
  @incompatible_schemas = []
  @schema_registry = build_schema_registry
  @compatibility_breaks = Avrolution::CompatibilityBreaksFile.load
  @logger = logger
end

Instance Attribute Details

#incompatible_schemasObject (readonly)

Returns the value of attribute incompatible_schemas.



9
10
11
# File 'lib/avrolution/compatibility_check.rb', line 9

def incompatible_schemas
  @incompatible_schemas
end

Instance Method Details

#callObject



26
27
28
29
# File 'lib/avrolution/compatibility_check.rb', line 26

def call
  check_schemas(Avrolution.root)
  self
end

#success?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/avrolution/compatibility_check.rb', line 31

def success?
  incompatible_schemas.empty?
end