Sha256: 6774967ddac08092d547bf488cdf16d71d91b2a6c49c92fee9ff80418c7230f1

Contents?: true

Size: 463 Bytes

Versions: 19

Compression:

Stored size: 463 Bytes

Contents

# frozen_string_literal: true
module Reek
  module AST
    module SexpExtensions
      # Utility methods for :const nodes.
      module ConstNode
        def name
          if namespace
            "#{namespace.format_to_ruby}::#{simple_name}"
          else
            simple_name.to_s
          end
        end

        def simple_name
          children.last
        end

        def namespace
          children.first
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
reek-4.5.6 lib/reek/ast/sexp_extensions/constant.rb
reek-4.5.5 lib/reek/ast/sexp_extensions/constant.rb
reek-4.5.4 lib/reek/ast/sexp_extensions/constant.rb
reek-4.5.3 lib/reek/ast/sexp_extensions/constant.rb
reek-4.5.2 lib/reek/ast/sexp_extensions/constant.rb
reek-4.5.1 lib/reek/ast/sexp_extensions/constant.rb
reek-4.5.0 lib/reek/ast/sexp_extensions/constant.rb
reek-4.4.2 lib/reek/ast/sexp_extensions/constant.rb
reek-4.4.1 lib/reek/ast/sexp_extensions/constant.rb
reek-4.4.0 lib/reek/ast/sexp_extensions/constant.rb
reek-4.3.0 lib/reek/ast/sexp_extensions/constant.rb
reek-4.2.5 lib/reek/ast/sexp_extensions/constant.rb
reek-4.2.4 lib/reek/ast/sexp_extensions/constant.rb
reek-4.2.3 lib/reek/ast/sexp_extensions/constant.rb
reek-4.2.2 lib/reek/ast/sexp_extensions/constant.rb
reek-4.2.1 lib/reek/ast/sexp_extensions/constant.rb
reek-4.2.0 lib/reek/ast/sexp_extensions/constant.rb
reek-4.1.1 lib/reek/ast/sexp_extensions/constant.rb
reek-4.1.0 lib/reek/ast/sexp_extensions/constant.rb