Class: BasicObject

### Home Classes Methods

### In Files

- lib/backports/basic_object.rb

### Parent

### Methods

- ::===
- ::inherited

### Class/Module Index

Quicksearch

- Prime
- Prime::EratosthenesGenerator
- Prime::EratosthenesSieve
- Prime::Generator23
- Prime::OldCompatibility
- Prime::PseudoPrimeGenerator
- Prime::TrialDivision
- Prime::TrialDivisionGenerator
- Backports
- Backports::MOST_EXTREME_OBJECT_EVER
- Backports::StdLib
- Backports::StdLib::LoadedFeatures
- Enumerator
- Enumerator::GeneratorBP
- Enumerator::Lazy
- Enumerator::Yielder
- Matrix
- Matrix::EigenvalueDecomposition
- Matrix::LUPDecomposition
- Random
- Random::Implementation
- Random::MT19937
- Enumerable
- Enumerable::Enumerator
- File
- File::Constants
- ARGF
- Array
- BasicObject
- Binding
- Complex
- Dir
- ENV
- Fixnum
- Float
- GC
- Hash
- IO
- Integer
- Kernel
- Math
- Method
- Module
- NilClass
- Numeric
- Object
- ObjectSpace
- OpenStruct
- Proc
- Process
- Range
- Regexp
- Set
- StopIteration
- String
- Struct
- Symbol
- UnboundMethod

No matching classes.

# BasicObject

### Constants

KEEP

### Public Class Methods

===(cmp) click to toggle source

    # File lib/backports/basic_object.rb, line 32
    def === (cmp)
      true
    end

inherited(sub) click to toggle source

Let's try to keep things clean, in case methods have been added to Object either directly or through an included module. We'll do this whenever a class is derived from BasicObject Ideally, we'd do this by trapping Object.method_added and M.method_added for any module M included in Object or a submodule Seems really though to get right, but pull requests welcome ;-)

    # File lib/backports/basic_object.rb, line 42
    def inherited(sub)
      BasicObject.class_eval do
        (instance_methods - KEEP).each do |method|
          if Object.method_defined?(method) && instance_method(method).owner == Object.instance_method(method).owner
            undef_method method
          end
        end
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.