Class: RbsGoose::Orthoses::Infer

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

Overview

Call RbsGoose::TypeInferrer to infer RBS type signatures.

use TbsGoose::Orthoses::Infer, code_dir: 'lib', sig_dir: 'sig' do |config|
  config.use_open_ai('open_ai_access_token')
end

Instance Method Summary collapse

Constructor Details

#initialize(loader, code_dir: 'lib', sig_dir: 'sig') ⇒ Infer

Returns a new instance of Infer.



12
13
14
15
16
17
# File 'lib/rbs_goose/orthoses/infer.rb', line 12

def initialize(loader, code_dir: 'lib', sig_dir: 'sig', &)
  @loader = loader
  @code_dir = code_dir
  @sig_dir = sig_dir
  RbsGoose.configure(&) if block_given?
end

Instance Method Details

#callObject



19
20
21
22
23
# File 'lib/rbs_goose/orthoses/infer.rb', line 19

def call
  @loader.call.tap do
    RbsGoose.run(code_dir: @code_dir, sig_dir: @sig_dir)
  end
end