Class: BitClust::LibraryScreen

Inherits:
EntryBoundScreen show all
Defined in:
lib/bitclust/screen.rb

Constant Summary

Constants included from VersionBadges

VersionBadges::SINCE_CATALOG_KEY, VersionBadges::SINCE_CSS_CLASS, VersionBadges::UNTIL_CATALOG_KEY, VersionBadges::UNTIL_CSS_CLASS

Constants included from NameUtils

NameUtils::CHAR_TO_MARK, NameUtils::CHAR_TO_NAME, NameUtils::CLASS_NAME_RE, NameUtils::CLASS_PATH_RE, NameUtils::CONST_PATH_RE, NameUtils::CONST_RE, NameUtils::GVAR_RE, NameUtils::LIBNAME_RE, NameUtils::MARK_TO_CHAR, NameUtils::MARK_TO_NAME, NameUtils::METHOD_NAME_RE, NameUtils::METHOD_SPEC_RE, NameUtils::MID, NameUtils::NAME_TO_CHAR, NameUtils::NAME_TO_MARK, NameUtils::TYPEMARK_RE

Instance Method Summary collapse

Methods inherited from EntryBoundScreen

#encoding, #initialize

Methods inherited from TemplateScreen

#content_type, #encoding, #eol_warning?, #google_tag_manager, #initialize, #meta_description, #meta_robots, #ruby_version, #run_ruby_wasm_url

Methods included from VersionBadges

#heading_version_badges, #row_version_badges

Methods included from NameUtils

build_method_id, classid2name, classname2id, classname?, decodeid, decodename_fs, decodename_url, display_typemark, encodeid, encodename_fs, encodename_rdocurl, encodename_url, functionname?, gvarname?, html_filename, libid2name, libname2id, libname?, method_spec?, methodid2classid, methodid2libid, methodid2mname, methodid2specparts, methodid2specstring, methodid2typechar, methodid2typemark, methodid2typename, methodname?, split_method_id, split_method_spec, typechar2mark, typechar2name, typechar?, typemark2char, typemark2name, typemark?, typename2char, typename2mark, typename?

Methods inherited from Screen

#response, #status

Constructor Details

This class inherits a constructor from BitClust::EntryBoundScreen

Instance Method Details

#bodyObject



598
599
600
# File 'lib/bitclust/screen.rb', line 598

def body
  run_template('library')
end

#current_urlObject



618
619
620
# File 'lib/bitclust/screen.rb', line 618

def current_url
  @urlmapper.library_url(@entry.name)
end

#draw_tree(cs, &block) ⇒ Object



602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
# File 'lib/bitclust/screen.rb', line 602

def draw_tree(cs, &block)
  return if cs.empty?
  if cs.first.class?
    tree = cs.group_by{|c| c.superclass } # steep:ignore
    tree.each {|key, list| list.sort_by!{|c| c ? c.name : "" } }
    roots = tree.keys.select{|c| !c || !cs.include?(c) }
    roots.map!{|c| tree[c] }.flatten! # steep:ignore
  else
    tree = {}
    roots = cs
  end
  # @type var roots: Array[ClassEntry]
  # @type var tree: Hash[ClassEntry, Array[ClassEntry]]
  draw_treed_entries(roots, tree, &block)
end