class RBS::CLI::Validate::Errors
Public Class Methods
(limit: Integer?) → void
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/cli/validate.rb, line 7 def initialize(limit:) @limit = limit @errors = [] end
Public Instance Methods
(BaseError) → void
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/cli/validate.rb, line 12 def add(error) @errors << error finish if @limit == 1 end
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/cli/validate.rb, line 25 def finish unless @errors.empty? @errors.each do |error| RBS.logger.error(build_message(error)) end throw @tag, 1 end 0 end
Throws the @tag with 0 or 1
Must be called from the block passed to try method.
() { () → void } → Integer
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/cli/validate.rb, line 17 def try(&block) catch(:finish) do |tag| @tag = tag yield finish() end end