mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 21:24:59 +00:00
More Rubocopping
This commit is contained in:
@@ -39,7 +39,7 @@ class Event
|
||||
# proc { |sender,arg0,arg1,...| }
|
||||
def trigger(*arg)
|
||||
arglist = arg[1, arg.length]
|
||||
for callback in @callbacks
|
||||
@callbacks.each do |callback|
|
||||
if callback.arity > 2 && arg.length == callback.arity
|
||||
# Retrofitted for callbacks that take three or more arguments
|
||||
callback.call(*arg)
|
||||
@@ -53,7 +53,7 @@ class Event
|
||||
# by the code where the event occurred. The first argument is the sender of
|
||||
# the event, the other arguments are the event's parameters.
|
||||
def trigger2(*arg)
|
||||
for callback in @callbacks
|
||||
@callbacks.each do |callback|
|
||||
callback.call(*arg)
|
||||
end
|
||||
end
|
||||
@@ -83,7 +83,7 @@ class HandlerHash
|
||||
return ret if ret
|
||||
mod = Object.const_get(@mod) rescue nil
|
||||
return nil if !mod
|
||||
for key in mod.constants
|
||||
mod.constants.each do |key|
|
||||
next if mod.const_get(key) != sym
|
||||
ret = key.to_sym
|
||||
@symbolCache[sym] = ret
|
||||
@@ -112,7 +112,7 @@ class HandlerHash
|
||||
def copy(src, *dests)
|
||||
handler = self[src]
|
||||
if handler
|
||||
for dest in dests
|
||||
dests.each do |dest|
|
||||
self.add(dest, handler)
|
||||
end
|
||||
end
|
||||
@@ -125,7 +125,7 @@ class HandlerHash
|
||||
symbol = toSymbol(sym)
|
||||
ret = @hash[symbol] if symbol && @hash[symbol] # Symbol or string
|
||||
unless ret
|
||||
for addif in @addIfs
|
||||
@addIfs.each do |addif|
|
||||
return addif[1] if addif[0].call(id)
|
||||
end
|
||||
end
|
||||
@@ -155,7 +155,7 @@ class HandlerHash2
|
||||
def [](sym)
|
||||
sym = sym.id if !sym.is_a?(Symbol) && sym.respond_to?("id")
|
||||
return @hash[sym] if sym && @hash[sym]
|
||||
for add_if in @add_ifs
|
||||
@add_ifs.each do |add_if|
|
||||
return add_if[1] if add_if[0].call(sym)
|
||||
end
|
||||
return nil
|
||||
@@ -178,7 +178,7 @@ class HandlerHash2
|
||||
def copy(src, *dests)
|
||||
handler = self[src]
|
||||
return if !handler
|
||||
for dest in dests
|
||||
dests.each do |dest|
|
||||
self.add(dest, handler)
|
||||
end
|
||||
end
|
||||
@@ -209,7 +209,7 @@ class HandlerHashBasic
|
||||
ret = nil
|
||||
ret = @hash[entry] if entry && @hash[entry]
|
||||
unless ret
|
||||
for addif in @addIfs
|
||||
@addIfs.each do |addif|
|
||||
return addif[1] if addif[0].call(entry)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user