Class: RbsGoose::Orthoses::FixError

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

Overview

Call RbsGoose::TypeInferrer to fix steep type errors.

use TbsGoose::Orthoses::FixError, 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') ⇒ FixError

Returns a new instance of FixError.



12
13
14
15
16
17
# File 'lib/rbs_goose/orthoses/fix_error.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/fix_error.rb', line 19

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