lib/tapioca/gem/events.rb in tapioca-0.8.3 vs lib/tapioca/gem/events.rb in tapioca-0.9.0
- old
+ new
@@ -1,10 +1,8 @@
# typed: strict
# frozen_string_literal: true
-require "pathname"
-
module Tapioca
module Gem
class Event
extend T::Sig
extend T::Helpers
@@ -40,10 +38,24 @@
@symbol = symbol
@constant = constant
end
end
+ class ForeignConstantFound < ConstantFound
+ extend T::Sig
+
+ sig { override.returns(Module) }
+ def constant
+ T.cast(@constant, Module)
+ end
+
+ sig { params(symbol: String, constant: Module).void }
+ def initialize(symbol, constant)
+ super
+ end
+ end
+
class NodeAdded < Event
extend T::Helpers
extend T::Sig
abstract!
@@ -85,9 +97,11 @@
def initialize(symbol, constant, node)
super(symbol, constant)
@node = node
end
end
+
+ class ForeignScopeNodeAdded < ScopeNodeAdded; end
class MethodNodeAdded < NodeAdded
extend T::Sig
sig { returns(RBI::Method) }