Sha256: f15ca41d98a8b0f8fa25650ecc799ea3cee17d32c66bd3007f720603a7da8244

Contents?: true

Size: 1018 Bytes

Versions: 30

Compression:

Stored size: 1018 Bytes

Contents

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)
  return unless @ctor = ctors.find {|o| o.name == :initialize }
  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 {|o| o.path }.map do |child|
    name = child.path
    if object.namespace
      name = object.relative_path(child)
    end
    [name, child]
  end
  erb(:subclasses)
end

Version data entries

30 entries across 21 versions & 3 rubygems

Version Path
challah-1.0.0.beta vendor/bundle/gems/yard-0.8.3/templates/default/class/setup.rb
challah-0.9.1.beta.3 vendor/bundle/gems/yard-0.8.3/templates/default/class/setup.rb
challah-0.9.1.beta vendor/bundle/gems/yard-0.8.3/templates/default/class/setup.rb
challah-0.9.0 vendor/bundle/gems/yard-0.8.3/templates/default/class/setup.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/yard-0.8.3/templates/default/class/setup.rb
challah-rolls-0.2.0 vendor/bundle/gems/yard-0.8.2.1/templates/default/class/setup.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.0.pre/vendor/bundle/gems/yard-0.8.2.1/templates/default/class/setup.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/yard-0.8.2.1/templates/default/class/setup.rb
challah-rolls-0.2.0 vendor/bundle/gems/yard-0.8.3/templates/default/class/setup.rb
challah-0.8.3 vendor/bundle/gems/yard-0.8.3/templates/default/class/setup.rb
challah-0.8.3 vendor/bundle/gems/yard-0.8.2.1/templates/default/class/setup.rb
yard-0.8.3 templates/default/class/setup.rb
challah-0.8.1 vendor/bundle/gems/yard-0.8.2.1/templates/default/class/setup.rb
challah-rolls-0.1.0 vendor/bundle/gems/challah-0.8.0.pre/vendor/bundle/gems/yard-0.8.2.1/templates/default/class/setup.rb
challah-rolls-0.1.0 vendor/bundle/gems/yard-0.8.2.1/templates/default/class/setup.rb
challah-0.8.0.pre vendor/bundle/gems/yard-0.8.2.1/templates/default/class/setup.rb
challah-0.7.1 vendor/bundle/gems/yard-0.8.2.1/templates/default/class/setup.rb
challah-0.7.0 vendor/bundle/gems/yard-0.8.2.1/templates/default/class/setup.rb
challah-0.7.0.pre2 vendor/bundle/gems/yard-0.8.2.1/templates/default/class/setup.rb
challah-0.7.0.pre vendor/bundle/gems/yard-0.8.2.1/templates/default/class/setup.rb