Class: Solargraph::Plugin::Panel

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source_maps: [], live_map: nil, gem_names: []) ⇒ Panel

Returns a new instance of Panel.



8
9
10
11
12
# File 'lib/solargraph/plugin/panel.rb', line 8

def initialize source_maps: [], live_map: nil, gem_names: []
  @source_maps = source_maps
  @live_map = live_map
  @gem_names = gem_names
end

Instance Attribute Details

#gem_names ⇒ Object (readonly)

Returns the value of attribute gem_names.



6
7
8
# File 'lib/solargraph/plugin/panel.rb', line 6

def gem_names
  @gem_names
end

#live_map ⇒ Object (readonly)

Returns the value of attribute live_map.



6
7
8
# File 'lib/solargraph/plugin/panel.rb', line 6

def live_map
  @live_map
end

#source_maps ⇒ Object (readonly)

Returns the value of attribute source_maps.



6
7
8
# File 'lib/solargraph/plugin/panel.rb', line 6

def source_maps
  @source_maps
end

Instance Method Details

#pins ⇒ Object



14
15
16
# File 'lib/solargraph/plugin/panel.rb', line 14

def pins
  @pins ||= source_maps.flat_map(&:pins)
end

#pins_by_class(klass) ⇒ Object



18
19
20
# File 'lib/solargraph/plugin/panel.rb', line 18

def pins_by_class klass
  pin_class_hash[klass] || []
end

#pins_by_path(path) ⇒ Object



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

def pins_by_path path
  pin_path_hash[path] || []
end