class RubyDetective::SourceRepresentation::Entities::Base

Constants

ROOT_SIGN_SYMBOL

Public Instance Methods

absolute_path?() click to toggle source
# File lib/ruby_detective/source_representation/entities/base.rb, line 7
def absolute_path?
  namespace.first == ROOT_SIGN_SYMBOL
end
namespace_as_text() click to toggle source
# File lib/ruby_detective/source_representation/entities/base.rb, line 36
def namespace_as_text
  if absolute_path?
    "::" + namespace_without_root_sign.join("::")
  else
    namespace.join("::")
  end
end
namespace_without_root_sign() click to toggle source

Removes the :“::” symbol from the namespace

# File lib/ruby_detective/source_representation/entities/base.rb, line 20
def namespace_without_root_sign
  if absolute_path?
    namespace[1..-1]
  else
    namespace
  end
end
path() click to toggle source
# File lib/ruby_detective/source_representation/entities/base.rb, line 11
def path
  namespace + [name]
end
path_as_text() click to toggle source
# File lib/ruby_detective/source_representation/entities/base.rb, line 28
def path_as_text
  if absolute_path?
    "::" + path_without_root_sign.join("::")
  else
    path.join("::")
  end
end
path_without_root_sign() click to toggle source
# File lib/ruby_detective/source_representation/entities/base.rb, line 15
def path_without_root_sign
  namespace_without_root_sign + [name]
end