Class: Tapioca::Gem::Listeners::Base Abstract

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/tapioca/gem/listeners/base.rb

Overview

This class is abstract.

Instance Method Summary collapse

Constructor Details

#initialize(pipeline) ⇒ Base

: (Pipeline pipeline) -> void



11
12
13
# File 'lib/tapioca/gem/listeners/base.rb', line 11

def initialize(pipeline)
  @pipeline = pipeline
end

Instance Method Details

#dispatch(event) ⇒ Object

: (NodeAdded event) -> void



16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/tapioca/gem/listeners/base.rb', line 16

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