Code tidying with Rubocop

This commit is contained in:
Maruno17
2023-07-18 22:42:10 +01:00
parent 6053363715
commit a5734eaf46
68 changed files with 276 additions and 232 deletions

View File

@@ -210,7 +210,8 @@ class HandlerHashEnum
@symbolCache = {}
end
def [](sym) # 'sym' can be an ID or symbol
# 'sym' can be an ID or symbol.
def [](sym)
id = fromSymbol(sym)
ret = nil
ret = @hash[id] if id && @hash[id] # Real ID from the item
@@ -246,7 +247,8 @@ class HandlerHashEnum
return ret
end
def add(sym, handler = nil, &handlerBlock) # 'sym' can be an ID or symbol
# 'sym' can be an ID or symbol.
def add(sym, handler = nil, &handlerBlock)
if ![Proc, Hash].include?(handler.class) && !block_given?
raise ArgumentError, "#{self.class.name} for #{sym.inspect} has no valid handler (#{handler.inspect} was given)"
end