mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
ec1f9860b1
added parentheses to all `to_enum` and `super` calls where the return value is used (returned, assigned, or passed to another method). this makes the code style consistent with the guideline that method calls should use parentheses when their return values are consumed. changes: - return to_enum :symbol -> return to_enum(:symbol) - return to_enum :symbol, arg -> return to_enum(:symbol, arg) - super message, name -> super(message, name) affected files: 10error.rb, array.rb, enum.rb, hash.rb, kernel.rb, numeric.rb, range.rb Co-authored-by: Claude <noreply@anthropic.com>
24 lines
387 B
Ruby
24 lines
387 B
Ruby
# ISO 15.2.31
|
|
class NameError < StandardError
|
|
attr_accessor :name
|
|
|
|
def initialize(message=nil, name=nil)
|
|
@name = name
|
|
super(message)
|
|
end
|
|
end
|
|
|
|
# ISO 15.2.32
|
|
class NoMethodError < NameError
|
|
attr_reader :args
|
|
|
|
def initialize(message=nil, name=nil, args=nil)
|
|
@args = args
|
|
super(message, name)
|
|
end
|
|
end
|
|
|
|
class StopIteration < IndexError
|
|
attr_accessor :result
|
|
end
|