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:

  • workspace (Workspace) (defaults to: Workspace.new)
  • opened (Array<Source>) (defaults to: [])


16
17
18
19
# File 'lib/solargraph/bundle.rb', line 16

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

Instance Attribute Details

#openedArray<Source> (readonly)

Returns:



12
13
14
# File 'lib/solargraph/bundle.rb', line 12

def opened
  @opened
end

#workspaceWorkspace (readonly)

Returns:



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

def workspace
  @workspace
end

Instance Method Details

#sourcesArray<Source>

Returns:



22
23
24
# File 'lib/solargraph/bundle.rb', line 22

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