Sha256: a9ea157cef0548c37b95a7846007e5b94728b450e13355d8ef40eb0704367d45

Contents?: true

Size: 602 Bytes

Versions: 6

Compression:

Stored size: 602 Bytes

Contents

# typed: strict
# frozen_string_literal: true

module Spoom
  module Deadcode
    # A reference is a call to a method or a constant
    class Reference < T::Struct
      extend T::Sig

      class Kind < T::Enum
        enums do
          Constant = new
          Method = new
        end
      end

      const :kind, Kind
      const :name, String
      const :location, Location

      # Kind

      sig { returns(T::Boolean) }
      def constant?
        kind == Kind::Constant
      end

      sig { returns(T::Boolean) }
      def method?
        kind == Kind::Method
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
spoom-1.3.2 lib/spoom/deadcode/reference.rb
spoom-1.3.1 lib/spoom/deadcode/reference.rb
spoom-1.3.0 lib/spoom/deadcode/reference.rb
spoom-1.2.4 lib/spoom/deadcode/reference.rb
spoom-1.2.3 lib/spoom/deadcode/reference.rb
spoom-1.2.2 lib/spoom/deadcode/reference.rb