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
mdg-1.0.1 vendor/bundle/ruby/2.3.0/gems/activesupport-3.2.22.5/lib/active_support/core_ext/module/remove_method.rb
activesupport-3.2.22.5 lib/active_support/core_ext/module/remove_method.rb
activesupport-3.2.22.4 lib/active_support/core_ext/module/remove_method.rb
activesupport-3.2.22.3 lib/active_support/core_ext/module/remove_method.rb
activesupport-3.2.22.2 lib/active_support/core_ext/module/remove_method.rb
activesupport-3.2.22.1 lib/active_support/core_ext/module/remove_method.rb
classiccms-0.7.5 vendor/bundle/gems/activesupport-3.2.3/lib/active_support/core_ext/module/remove_method.rb
classiccms-0.7.4 vendor/bundle/gems/activesupport-3.2.3/lib/active_support/core_ext/module/remove_method.rb
classiccms-0.7.3 vendor/bundle/gems/activesupport-3.2.3/lib/active_support/core_ext/module/remove_method.rb
active_mailer-0.0.10 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/core_ext/module/remove_method.rb
activesupport-3.2.22 lib/active_support/core_ext/module/remove_method.rb
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/activesupport-3.2.12/lib/active_support/core_ext/module/remove_method.rb
activesupport-3.2.21 lib/active_support/core_ext/module/remove_method.rb
apl-library-0.0.90 vendor/bundle/ruby/1.8/gems/activesupport-3.2.18/lib/active_support/core_ext/module/remove_method.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.18/lib/active_support/core_ext/module/remove_method.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.8/gems/activesupport-3.2.18/lib/active_support/core_ext/module/remove_method.rb
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.18/lib/active_support/core_ext/module/remove_method.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/activesupport-3.2.18/lib/active_support/core_ext/module/remove_method.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/2.1.0/gems/activesupport-3.2.18/lib/active_support/core_ext/module/remove_method.rb
activesupport-3.2.20 lib/active_support/core_ext/module/remove_method.rb