APIdock / Ruby on Rails
/
Browse About
method

subclasses

v3.0.0 - Show latest stable - Class: Class
subclasses()
public

Returns an array with the direct children of self.

  Integer.subclasses # => [Bignum, Fixnum]
# File activesupport/lib/active_support/core_ext/class/subclasses.rb, line 42
    def subclasses
      subclasses, chain = [], descendants
      chain.each do |k|
        subclasses << k unless chain.any? { |c| c > k }
      end
      subclasses
    end

Related methods

  • Instance methods
  • cattr_accessor
  • cattr_reader
  • cattr_writer
  • class_attribute
  • class_inheritable_accessor
  • class_inheritable_array
  • class_inheritable_array_writer
  • class_inheritable_hash
  • class_inheritable_hash_writer
  • class_inheritable_reader
  • class_inheritable_writer
  • descendants
  • descendants
  • descendants
  • duplicable?
  • extlib_inheritable_accessor
  • extlib_inheritable_reader
  • extlib_inheritable_writer
  • inheritable_attributes
  • read_inheritable_attribute
  • reset_inheritable_attributes
  • subclasses
  • superclass_delegating_accessor
  • write_inheritable_array
  • write_inheritable_attribute
  • write_inheritable_hash
  • Private methods
  • private_stash_object_in_method
  • private_superclass_delegating_accessor
  • privateinherited
  • privateinherited_with_inheritable_attributes
APIdock API Documentation Browser

© 2026 APIdock