Sha256: 0a45c406f2ec12bca39d2b0f54543c4be2683432721fbc5db366986ee0a39a9b

Contents?: true

Size: 440 Bytes

Versions: 7

Compression:

Stored size: 440 Bytes

Contents

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

        def simple_name
          children.last
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
reek-4.0.5 lib/reek/ast/sexp_extensions/constant.rb
reek-4.0.4 lib/reek/ast/sexp_extensions/constant.rb
reek-4.0.3 lib/reek/ast/sexp_extensions/constant.rb
reek-4.0.2 lib/reek/ast/sexp_extensions/constant.rb
reek-4.0.1 lib/reek/ast/sexp_extensions/constant.rb
reek-4.0.0 lib/reek/ast/sexp_extensions/constant.rb
reek-4.0.0.pre1 lib/reek/ast/sexp_extensions/constant.rb