Class: Solargraph::RbsMap::StdlibMap

Inherits:
Solargraph::RbsMap show all
Defined in:
lib/solargraph/rbs_map/stdlib_map.rb

Overview

Ruby stdlib pins

Instance Attribute Summary

Attributes inherited from Solargraph::RbsMap

#library

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Solargraph::RbsMap

from_gemspec, #path_pin, #path_pins, #repository, #resolved?

Methods included from Conversions

#pins

Constructor Details

#initialize(library) ⇒ StdlibMap

Returns a new instance of StdlibMap.

Parameters:

  • library (String)


14
15
16
17
18
19
20
21
22
23
24
# File 'lib/solargraph/rbs_map/stdlib_map.rb', line 14

def initialize library
  cache = Cache.load('stdlib', "#{library}.ser")
  if cache
    pins.replace cache
    @resolved = true
  else
    super
    return unless resolved?
    Cache.save('stdlib', "#{library}.ser", pins)
  end
end

Class Method Details

.load(library) ⇒ StdlibMap

Parameters:

  • library (String)

Returns:



28
29
30
# File 'lib/solargraph/rbs_map/stdlib_map.rb', line 28

def self.load library
  @stdlib_maps_hash[library] ||= StdlibMap.new(library)
end