lib/cc/analyzer.rb
When using method_missing
, define respond_to_missing?
. Open
Open
def method_missing(*)
yield if block_given?
end
- Read upRead up
- Exclude checks
Checks for the presence of method_missing
without also
defining respond_to_missing?
.
Example:
#bad
def method_missing(name, *args)
# ...
end
#good
def respond_to_missing?(name, include_private)
# ...
end
def method_missing(name, *args)
# ...
end
When using method_missing
, define respond_to_missing?
. Open
Open
def method_missing(*)
yield if block_given?
end
- Read upRead up
- Exclude checks
Checks for the presence of method_missing
without also
defining respond_to_missing?
.
Example:
#bad
def method_missing(name, *args)
# ...
end
#good
def respond_to_missing?(name, include_private)
# ...
end
def method_missing(name, *args)
# ...
end