Class: Tapioca::Gem::Listeners::Base
- Inherits:
-
Object
- Object
- Tapioca::Gem::Listeners::Base
- Extended by:
- T::Helpers, T::Sig
- Defined in:
- lib/tapioca/gem/listeners/base.rb
Direct Known Subclasses
DynamicMixins, ForeignConstants, Methods, Mixins, RemoveEmptyPayloadScopes, SorbetEnums, SorbetHelpers, SorbetProps, SorbetRequiredAncestors, SorbetSignatures, SorbetTypeVariables, SourceLocation, Subconstants, YardDoc
Instance Method Summary collapse
- #dispatch(event) ⇒ Object
-
#initialize(pipeline) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(pipeline) ⇒ Base
Returns a new instance of Base.
14 15 16 |
# File 'lib/tapioca/gem/listeners/base.rb', line 14 def initialize(pipeline) @pipeline = pipeline end |
Instance Method Details
#dispatch(event) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/tapioca/gem/listeners/base.rb', line 19 def dispatch(event) return if ignore?(event) case event when ConstNodeAdded on_const(event) when ScopeNodeAdded on_scope(event) when MethodNodeAdded on_method(event) else raise "Unsupported event #{event.class}" end end |