Sha256: c4b0bda981256664db5006af132cc275d106136726da5d44ef3e95908bd0e7a7

Contents?: true

Size: 502 Bytes

Versions: 5

Compression:

Stored size: 502 Bytes

Contents

# typed: strict
# frozen_string_literal: true

require "ast"

module Packwerk
  # An interface describing an object that can extract a constant name from an AST node.
  module ConstantNameInspector
    extend T::Sig
    extend T::Helpers

    interface!

    sig do
      abstract
        .params(node: ::AST::Node, ancestors: T::Array[::AST::Node])
        .returns(T.nilable(String))
    end
    def constant_name_from_node(node, ancestors:); end
  end

  private_constant :ConstantNameInspector
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
packwerk-3.2.1 lib/packwerk/constant_name_inspector.rb
packwerk-3.2.0 lib/packwerk/constant_name_inspector.rb
packwerk-3.1.0 lib/packwerk/constant_name_inspector.rb
packwerk-3.0.1 lib/packwerk/constant_name_inspector.rb
packwerk-3.0.0 lib/packwerk/constant_name_inspector.rb