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

#path_pin, #path_pins, #resolved?

Methods included from Conversions

#pins

Constructor Details

#initialize(library) ⇒ StdlibMap

Returns a new instance of StdlibMap.

Parameters:

  • library (String)


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

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

Class Method Details

.load(library) ⇒ StdlibMap

Parameters:

  • library (String)

Returns:



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

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

Instance Method Details

#repositoryObject



31
32
33
# File 'lib/solargraph/rbs_map/stdlib_map.rb', line 31

def repository
  @repository ||= RBS::Repository.new
end