Sha256: 4e1e53cc68870097472fbb07838bb097f8839c2322d510b27853ed00928e72ba
Contents?: true
Size: 756 Bytes
Versions: 60
Compression:
Stored size: 756 Bytes
Contents
# frozen_string_literal: true module RuboCop module Cop module Style # This cop checks for the presence of `method_missing` without # falling back on `super`. # # @example # #bad # def method_missing(name, *args) # # ... # end # # #good # # def method_missing(name, *args) # # ... # super # end class MethodMissingSuper < Cop MSG = 'When using `method_missing`, fall back on `super`.' def on_def(node) return unless node.method?(:method_missing) return if node.descendants.any?(&:zsuper_type?) add_offense(node) end alias on_defs on_def end end end end
Version data entries
60 entries across 41 versions & 5 rubygems