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.



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

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.



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

def incompatible_schemas
  @incompatible_schemas
end

Instance Method Details

#callObject



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

def call
  check_schemas(Avrolution.root)
  self
end

#success?Boolean

Returns:

  • (Boolean)


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

def success?
  incompatible_schemas.empty?
end