Sha256: 653b0ac9f5a230bd783b3c2550f9fadebd9d40a5b1fb7a6fae4be98347e7b6d0

Contents?: true

Size: 464 Bytes

Versions: 292

Compression:

Stored size: 464 Bytes

Contents

class Module
  def remove_possible_method(method)
    if method_defined?(method) || private_method_defined?(method)
      remove_method(method)
    end
  rescue NameError
    # If the requested method is defined on a superclass or included module,
    # method_defined? returns true but remove_method throws a NameError.
    # Ignore this.
  end

  def redefine_method(method, &block)
    remove_possible_method(method)
    define_method(method, &block)
  end
end

Version data entries

292 entries across 248 versions & 26 rubygems

Version Path
activesupport-3.2.19 lib/active_support/core_ext/module/remove_method.rb
activesupport-3.2.18 lib/active_support/core_ext/module/remove_method.rb
whois-3.5.0 lib/whois/core_ext/module/remove_method.rb
whois-3.4.5 lib/whois/core_ext/module/remove_method.rb
activesupport-3.2.17 lib/active_support/core_ext/module/remove_method.rb
whois-3.4.4 lib/whois/core_ext/module/remove_method.rb
whois-3.4.3 lib/whois/core_ext/module/remove_method.rb
activesupport-3.2.16 lib/active_support/core_ext/module/remove_method.rb
whois-3.4.2 lib/whois/core_ext/module/remove_method.rb
whois-3.4.1 lib/whois/core_ext/module/remove_method.rb
whois-3.4.0 lib/whois/core_ext/module/remove_method.rb
activesupport-3.2.15 lib/active_support/core_ext/module/remove_method.rb
whois-3.3.1 lib/whois/core_ext/module/remove_method.rb
activesupport-3.2.15.rc3 lib/active_support/core_ext/module/remove_method.rb
whois-3.3.0 lib/whois/core_ext/module/remove_method.rb
activesupport-3.2.15.rc2 lib/active_support/core_ext/module/remove_method.rb
activesupport-3.2.15.rc1 lib/active_support/core_ext/module/remove_method.rb
activesupport-3.2.14 lib/active_support/core_ext/module/remove_method.rb
activesupport-3.2.14.rc2 lib/active_support/core_ext/module/remove_method.rb
whois-3.2.1 lib/whois/core_ext/module/remove_method.rb