Class: RubyLsp::Ree::LinksParser
- Inherits:
-
BasicParser
- Object
- BasicParser
- RubyLsp::Ree::LinksParser
- Defined in:
- lib/ruby_lsp/ruby_lsp_ree/parsing/body_parsers/links_parser.rb
Instance Attribute Summary collapse
-
#container ⇒ Object
readonly
Returns the value of attribute container.
Instance Method Summary collapse
-
#initialize(container, package_name) ⇒ LinksParser
constructor
A new instance of LinksParser.
- #parse_links ⇒ Object
Methods inherited from BasicParser
Constructor Details
#initialize(container, package_name) ⇒ LinksParser
Returns a new instance of LinksParser.
7 8 9 10 |
# File 'lib/ruby_lsp/ruby_lsp_ree/parsing/body_parsers/links_parser.rb', line 7 def initialize(container, package_name) @container = container @document_package_name = package_name end |
Instance Attribute Details
#container ⇒ Object (readonly)
Returns the value of attribute container.
5 6 7 |
# File 'lib/ruby_lsp/ruby_lsp_ree/parsing/body_parsers/links_parser.rb', line 5 def container @container end |
Instance Method Details
#parse_links ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/ruby_lsp/ruby_lsp_ree/parsing/body_parsers/links_parser.rb', line 12 def parse_links nodes = container.select{ |node| node_name(node) == :link || node_name(node) == :import } nodes.map do |link_node| RubyLsp::Ree::ParsedLinkNodeBuilder.build_from_node(link_node, @document_package_name) end end |