Class: Solargraph::YardMap::Mapper
- Inherits:
-
Object
- Object
- Solargraph::YardMap::Mapper
- Defined in:
- lib/solargraph/yard_map/mapper.rb,
lib/solargraph/yard_map/mapper/to_method.rb,
lib/solargraph/yard_map/mapper/to_constant.rb,
lib/solargraph/yard_map/mapper/to_namespace.rb
Defined Under Namespace
Modules: ToConstant, ToMethod, ToNamespace
Instance Method Summary collapse
-
#initialize(code_objects, spec = nil) ⇒ Mapper
constructor
A new instance of Mapper.
- #map ⇒ Array<Pin::Base>
Constructor Details
#initialize(code_objects, spec = nil) ⇒ Mapper
Returns a new instance of Mapper.
12 13 14 15 16 17 |
# File 'lib/solargraph/yard_map/mapper.rb', line 12 def initialize code_objects, spec = nil @code_objects = code_objects @spec = spec @pins = [] @namespace_pins = {} end |
Instance Method Details
#map ⇒ Array<Pin::Base>
20 21 22 23 24 25 26 27 28 |
# File 'lib/solargraph/yard_map/mapper.rb', line 20 def map @code_objects.each do |co| @pins.concat generate_pins co end # Some yardocs contain documentation for dependencies that can be # ignored here. The YardMap will load dependencies separately. @pins.keep_if { |pin| pin.location.nil? || File.file?(pin.location.filename) } if @spec @pins end |