# Class: YARD::Server::Commands::ListCommand

Inherits:
  LibraryCommand
  - Object
  - Base
  - LibraryCommand
  - YARD::Server::Commands::ListCommand
  show all

Includes:
  Templates::Helpers::BaseHelper

Defined in:
  lib/yard/server/commands/list_command.rb

## Overview

Returns a list of objects of a specific type

Since:

- 0.6.0

## Instance Attribute Summary

### Attributes included from Templates::Helpers::BaseHelper

#object, #owner, #serializer

## Instance Method Summary collapse

- #run ⇒ Object

### Methods included from Templates::Helpers::BaseHelper

#format_object_title, #format_object_type, #format_source, #format_types, #globals, #h, #link_file, #link_include_file, #link_include_object, #link_object, #link_url, #linkify, #run_verifier

### Methods included from StaticCaching

#cache, #check_static_cache

## Constructor Details

This class inherits a constructor from YARD::Server::Commands::LibraryCommand

## Instance Method Details

### #run ⇒ `Object`

Since:

- 0.6.0

    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21

    # File 'lib/yard/server/commands/list_command.rb', line 9

    def run
      Registry.load_all
      options.update(:objects => run_verifier(Registry.all(:class, :module)))
      list_type = request.path.split('/').last
      meth = "generate_#{list_type}_list"
      tpl = fulldoc_template
      if tpl.respond_to?(meth)
        tpl.send(meth)
        cache(tpl.contents)
      else
        not_found
      end
    end