lib/docrb/lib/docrb/ruby_parser.rb
def parse_class_path(path)
      return [[], :self] if path.try?(:type) == :self

      path = path.to_a
      name = path[1]
      parents = []
      parent = path.first.try?(:to_a) || []
      until parent&.empty?
        parents << parent.last
        parent = parent.first.to_a
      end
      [parents.reverse, name]
    end
# Parses a given class path into an interable list of objects representing
# its full path
#
# path - Path to be processed
#
# Returns a multidimensional array structure representing the path to the
# provided value.
Parses a given class path into an interable list of objects representing
its full path

Path to be processed

Returns a multidimensional array structure representing the path to the
provided value.
Parses a given class path into an interable list of objects representing its full path Path to be processed Returns a multidimensional array structure representing the path to the provided value .
def parse_class_path(path)
      return [[], :self] if path.try?(:type) == :self
      path = path.to_a
      name = path[1]
      parents = []
      parent = path.first.try?(:to_a) || []
      until parent&.empty?
        parents << parent.last
        parent = parent.first.to_a
      end
      [parents.reverse, name]
    end
def parse_class_path ( path ) return [ [ ] , :self ] if path . try? ( :type ) == :self path = path . to_a name = path [ 1 ] parents = [ ] parent = path . first . try? ( :to_a ) || [ ] until parent &. empty? parents << parent . last parent = parent . first . to_a end [ parents . reverse , name ] end
Parses a given class path into an interable list of objects representing
its full path
Parses a given class path into an interable list of objects representing its full path
path