lib/net_app_manageability/nam_array.rb
Use yield
instead of block.call
. Open
Open
block.arity < 1 ? self.instance_eval(&block) : block.call(self)
- Read upRead up
- Exclude checks
This cop identifies the use of a &block
parameter and block.call
where yield
would do just as well.
Example:
# bad
def method(&block)
block.call
end
def another(&func)
func.call 1, 2, 3
end
# good
def method
yield
end
def another
yield 1, 2, 3
end