class DuckTesting::YARD::Parser

Public Class Methods

parse(paths, excluded) click to toggle source

Parses a path or set of paths.

@param paths [String, Array<String>] a path, glob or list of paths to parse @param excluded [Array<String, Regexp>] a list of excluded path matchers @return [Array<DuckTesting::YARD::ClassObject>]

# File lib/duck_testing/yard/parser.rb, line 12
def parse(paths, excluded)
  ::YARD::Registry.clear
  ::YARD::Parser::SourceParser.parse(paths, excluded)
  ::YARD::Registry.all(:class).map { |class_object| ClassObject.new(class_object) }
end
parse_string(content) click to toggle source

Parses a string ‘content`.

@param content [String] the block of code to parse. @return [Array<DuckTesting::YARD::ClassObject>]

# File lib/duck_testing/yard/parser.rb, line 22
def parse_string(content)
  ::YARD::Registry.clear
  ::YARD::Parser::SourceParser.parse_string(content)
  ::YARD::Registry.all(:class).map { |class_object| ClassObject.new(class_object) }
end