Class: Inch::CodeObject::Provider::YARD::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/inch/code_object/provider/yard/parser.rb

Overview

Parses the source tree (using YARD)

Constant Summary collapse

IGNORE_TYPES =
[:macro]

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.parse(*args) ⇒ CodeObject::Provider::YARD::Parser

Helper method to parse an instance with the given args

Returns:

See Also:



13
14
15
16
17
# File 'lib/inch/code_object/provider/yard/parser.rb', line 13

def self.parse(*args)
  parser = self.new
  parser.parse(*args)
  parser
end

Instance Method Details

#objectsArray<YARD::Object::Base>

Returns:



30
31
32
33
34
# File 'lib/inch/code_object/provider/yard/parser.rb', line 30

def objects
  @objects ||= parsed_objects.map do |o|
    YARD::Object.for(o) unless IGNORE_TYPES.include?(o.type)
  end.compact
end

#parse(dir, config) ⇒ void

This method returns an undefined value.

Parameters:



22
23
24
25
26
27
# File 'lib/inch/code_object/provider/yard/parser.rb', line 22

def parse(dir, config)
  Dir.chdir(dir) do
    parse_yard_objects(config.included_files, config.excluded_files)
    inject_base_dir(dir)
  end
end