lib/poke-api/client.rb
When using method_missing
, define respond_to_missing?
. Open
Open
def method_missing(method, *args)
POGOProtos::Networking::Requests::RequestType.const_get(method.upcase)
@reqs << (args.empty? ? method.to_sym.upcase : { method.to_sym.upcase => args.first })
rescue NameError
super
- Read upRead up
- Exclude checks
This cop checks for the presence of method_missing
without also
defining respond_to_missing?
and falling back on super
.
Example:
#bad
def method_missing(name, *args)
# ...
end
#good
def respond_to_missing?(name, include_private)
# ...
end
def method_missing(name, *args)
# ...
super
end