Sha256: 8471991394e1745b7433583bb31726c2c10bb78edc4d3b7816fd6850ef4a9705

Contents?: true

Size: 1.03 KB

Versions: 7

Compression:

Stored size: 1.03 KB

Contents

include T('default/module')

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

def constructor_details
  ctors = object.meths(:inherited => true, :included => true)
  return unless @ctor = ctors.find {|o| o.constructor? }
  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

7 entries across 7 versions & 1 rubygems

Version Path
gooddata-0.6.6 doc/templates/default/class/setup.rb
gooddata-0.6.5 doc/templates/default/class/setup.rb
gooddata-0.6.4 doc/templates/default/class/setup.rb
gooddata-0.6.3 doc/templates/default/class/setup.rb
gooddata-0.6.2 doc/templates/default/class/setup.rb
gooddata-0.6.0 doc/templates/default/class/setup.rb
gooddata-0.6.0.pre11 doc/templates/default/class/setup.rb