Class: Solargraph::Bench

Inherits:
Object
  • Object
show all
Defined in:
lib/solargraph/bench.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: [], pins: []) ⇒ Bench

Returns a new instance of Bench.

Parameters:



19
20
21
22
23
# File 'lib/solargraph/bench.rb', line 19

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

Instance Attribute Details

#openedArray<Source> (readonly)

Returns:



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

def opened
  @opened
end

#pinsArray<Pin::Base> (readonly)

Returns:



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

def pins
  @pins
end

#workspaceWorkspace (readonly)

Returns:



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

def workspace
  @workspace
end

Instance Method Details

#sourcesArray<Source>

Returns:



26
27
28
# File 'lib/solargraph/bench.rb', line 26

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