Class: Solargraph::Collection::Stdlib

Inherits:
Base
  • Object
show all
Defined in:
lib/solargraph/collection/stdlib.rb

Overview

Cacheable stdlib pins.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#load, load, uncache

Constructor Details

#initialize(library) ⇒ Stdlib

Returns a new instance of Stdlib.

Parameters:

  • library (String)


11
12
13
14
# File 'lib/solargraph/collection/stdlib.rb', line 11

def initialize library
  super()
  @library = library
end

Instance Attribute Details

#library ⇒ Object (readonly)

Returns the value of attribute library.



8
9
10
# File 'lib/solargraph/collection/stdlib.rb', line 8

def library
  @library
end

Instance Method Details

#cache_file ⇒ Object



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

def cache_file
  File.join CacheDir.stdlib_dir, "#{library}.ser"
end

#pins ⇒ Object



16
17
18
# File 'lib/solargraph/collection/stdlib.rb', line 16

def pins
  @pins ||= RbsMap::Stdlib.pins(library)
end