Class: RBS::CLI::Validate::Errors
- Inherits:
-
Object
- Object
- RBS::CLI::Validate::Errors
- Defined in:
- lib/rbs/cli/validate.rb
Instance Method Summary collapse
- #add(error) ⇒ Object
- #finish ⇒ Object
-
#initialize(limit:, exit_error:) ⇒ Errors
constructor
A new instance of Errors.
Constructor Details
#initialize(limit:, exit_error:) ⇒ Errors
Returns a new instance of Errors.
7 8 9 10 11 12 |
# File 'lib/rbs/cli/validate.rb', line 7 def initialize(limit:, exit_error:) @limit = limit @exit_error = exit_error @errors = [] @has_syntax_error = false end |
Instance Method Details
#add(error) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/rbs/cli/validate.rb', line 14 def add(error) if error.instance_of?(WillSyntaxError) RBS.logger.warn((error)) @has_syntax_error = true else @errors << error end finish if @limit == 1 end |