Module: Reek::AST::SexpExtensions::ConstNode

Defined in:
lib/reek/ast/sexp_extensions/constant.rb

Overview

Utility methods for :const nodes.

Instance Method Summary collapse

Instance Method Details

#nameObject

TODO: name -> full_name, simple_name -> name



9
10
11
12
13
14
15
# File 'lib/reek/ast/sexp_extensions/constant.rb', line 9

def name
  if namespace
    "#{namespace.format_to_ruby}::#{simple_name}"
  else
    simple_name.to_s
  end
end

#namespaceObject



21
22
23
# File 'lib/reek/ast/sexp_extensions/constant.rb', line 21

def namespace
  children.first
end

#simple_nameObject



17
18
19
# File 'lib/reek/ast/sexp_extensions/constant.rb', line 17

def simple_name
  children.last
end