Class: Solargraph::Bundle

Inherits:
Object
  • Object
show all
Defined in:
lib/solargraph/bundle.rb

Overview

An aggregation of a workspace and additional sources to be cataloged in an ApiMap.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(workspace: Workspace.new, opened: []) ⇒ Bundle

Returns a new instance of Bundle

Parameters:


14
15
16
17
# File 'lib/solargraph/bundle.rb', line 14

def initialize workspace: Workspace.new, opened: []
  @workspace = workspace
  @opened = opened
end

Instance Attribute Details

#openedArray<Source> (readonly)

Returns:


10
11
12
# File 'lib/solargraph/bundle.rb', line 10

def opened
  @opened
end

#workspaceWorkspace (readonly)

Returns:


7
8
9
# File 'lib/solargraph/bundle.rb', line 7

def workspace
  @workspace
end

Instance Method Details

#sourcesArray<Source>

Returns:


20
21
22
# File 'lib/solargraph/bundle.rb', line 20

def sources
  @sources ||= (opened + workspace.sources).uniq(&:filename)
end