Class: RubyLsp::Ree::ParsedLinkNode::ImportItem

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_lsp/ruby_lsp_ree/parsing/parsed_link_node.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, original_name: nil) ⇒ ImportItem

Returns a new instance of ImportItem.



13
14
15
16
# File 'lib/ruby_lsp/ruby_lsp_ree/parsing/parsed_link_node.rb', line 13

def initialize(name:, original_name: nil)
  @name = name
  @original_name = original_name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



11
12
13
# File 'lib/ruby_lsp/ruby_lsp_ree/parsing/parsed_link_node.rb', line 11

def name
  @name
end

#original_nameObject (readonly)

Returns the value of attribute original_name.



11
12
13
# File 'lib/ruby_lsp/ruby_lsp_ree/parsing/parsed_link_node.rb', line 11

def original_name
  @original_name
end

Instance Method Details

#to_sObject



18
19
20
21
22
23
24
# File 'lib/ruby_lsp/ruby_lsp_ree/parsing/parsed_link_node.rb', line 18

def to_s
  if @original_name
    "#{@original_name}.as(#{@name})"
  else
    @name
  end
end