mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 13:15:01 +00:00
Code tidying with Rubocop
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user