Class: Orthoses::LoadRBS

Inherits:
Object
  • Object
show all
Defined in:
lib/orthoses/load_rbs.rb

Instance Method Summary collapse

Constructor Details

#initialize(loader, paths:) ⇒ LoadRBS

use Orthoses::LoadRBS,

paths: Dir.glob("known_sig/**/*.rbs")


7
8
9
10
# File 'lib/orthoses/load_rbs.rb', line 7

def initialize(loader, paths:)
  @loader = loader
  @paths = paths
end

Instance Method Details

#callObject



12
13
14
15
16
17
18
19
# File 'lib/orthoses/load_rbs.rb', line 12

def call
  @loader.call.tap do |store|
    paths = @paths
    paths = paths.call if paths.instance_of?(Proc)
    env = Content::Environment.load_from_paths(paths.to_a)
    env.write_to(store: store)
  end
end