Sha256: 787c2fd6c1b165d94af1c5c118f8d3e3fd418594ef05ae2dcd69c6c384e9d254

Contents?: true

Size: 1 KB

Versions: 64

Compression:

Stored size: 1 KB

Contents

# frozen_string_literal: true
include T('default/module')

def init
  super
  sections.place(:subclasses).before(:children)
  sections.place(:constructor_details, [T('method_details')]).before(:methodmissing)
end

def constructor_details
  ctors = object.meths(:inherited => true, :included => true)
  @ctor = ctors.find(&:constructor?)
  return unless @ctor
  return if prune_method_listing([@ctor]).empty?
  erb(:constructor_details)
end

def subclasses
  return if object.path == "Object" # don't show subclasses for Object
  unless globals.subclasses
    globals.subclasses = {}
    list = run_verifier Registry.all(:class)
    list.each do |o|
      (globals.subclasses[o.superclass.path] ||= []) << o if o.superclass
    end
  end

  @subclasses = globals.subclasses[object.path]
  return if @subclasses.nil? || @subclasses.empty?
  @subclasses = @subclasses.sort_by(&:path).map do |child|
    name = child.path
    name = object.relative_path(child) if object.namespace
    [name, child]
  end
  erb(:subclasses)
end

Version data entries

64 entries across 63 versions & 10 rubygems

Version Path
kinetic_sdk-5.0.29 gems/yard-0.9.36/templates/default/class/setup.rb
kinetic_sdk-5.0.28 gems/yard-0.9.36/templates/default/class/setup.rb
direct7-0.0.18 vendor/bundle/ruby/2.7.0/gems/yard-0.9.34/templates/default/class/setup.rb
direct7-0.0.17 vendor/bundle/ruby/2.7.0/gems/yard-0.9.34/templates/default/class/setup.rb
direct7-0.0.16 vendor/bundle/ruby/2.7.0/gems/yard-0.9.34/templates/default/class/setup.rb
yard-0.9.37 templates/default/class/setup.rb
kinetic_sdk-5.0.27 gems/yard-0.9.36/templates/default/class/setup.rb
kinetic_sdk-5.0.26 gems/yard-0.9.36/templates/default/class/setup.rb
kinetic_sdk-5.0.25 gems/yard-0.9.25/templates/default/class/setup.rb
kinetic_sdk-5.0.24 gems/yard-0.9.25/templates/default/class/setup.rb
direct7-0.0.13 vendor/bundle/ruby/2.7.0/gems/yard-0.9.34/templates/default/class/setup.rb
yard-0.9.36 templates/default/class/setup.rb
yard-0.9.35 templates/default/class/setup.rb
direct7-0.0.12 vendor/bundle/ruby/2.7.0/gems/yard-0.9.34/templates/default/class/setup.rb
kinetic_sdk-5.0.23 gems/yard-0.9.25/templates/default/class/setup.rb
getargv-0.3.3-universal-darwin vendor/bundle/ruby/3.3.0/gems/yard-0.9.34/templates/default/class/setup.rb
direct7-0.0.11 vendor/bundle/ruby/2.7.0/gems/yard-0.9.34/templates/default/class/setup.rb
kinetic_sdk-5.0.22 gems/yard-0.9.25/templates/default/class/setup.rb
kinetic_sdk-5.0.21 gems/yard-0.9.25/templates/default/class/setup.rb
yard-0.9.34 templates/default/class/setup.rb