Trying to understand dry-core deprecations

I am trying the understand how dry-core is implemented. I have some doubts regarding dry-core deprecations
We are using the module like this
class Foo
extend Dry::Core::Deprecations[:tag]
end

  1. When I extend a module I usually get the methods of that module as class methods. But looking at the module I see there are no methods defined in that module. Few methods are defined as class methods of Dry::Core::Deprecations (which I think cant be accessed from outside), few methods are defined inside a class Tagged and a few methods are defined inside another interface called Interface. So I am not able to understand how the method
    deprecate_class_method :old_class_api, :new_class_api
    is working as mentioned in the example. Acoording to me this method should not be available

  2. How is the tag being pushed from declaration (Dry::Core::Deprecations[:tag]) inside ?

.[] is a method defined on Dry::Core::Deprecations which builds a returns a module back, it’s a “standard” pattern in rom-rb/dry-rb gems

flash-gordon: activerecord uses a similar technique with class CreateProducts < ActiveRecord::Migration[6.0]