Class: YARD::Server::Commands::DisplayObjectCommand
- Inherits:
-
LibraryCommand
- Object
- Base
- LibraryCommand
- YARD::Server::Commands::DisplayObjectCommand
- Defined in:
- lib/yard/server/commands/display_object_command.rb
Overview
Displays documentation for a specific object identified by the path
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from LibraryCommand
incremental, library, options, serializer, single_library
Attributes inherited from Base
adapter, body, caching, command_options, headers, path, request, status
Instance Method Summary (collapse)
Methods inherited from LibraryCommand
Methods inherited from Base
#cache, #call, #initialize, #redirect, #render
Constructor Details
This class inherits a constructor from YARD::Server::Commands::LibraryCommand
Instance Method Details
- (Object) index
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/yard/server/commands/display_object_command.rb', line 17 def index Registry.load_all title = [:title] unless title title = "Documentation for #{library.name} #{library.version ? '(' + library.version + ')' : ''}" end .update( :object => '_index.html', :objects => Registry.all(:module, :class), :title => title, :type => :layout ) render end |
- (Object) not_found
33 34 35 36 |
# File 'lib/yard/server/commands/display_object_command.rb', line 33 def not_found super self.body = "Could not find object: #{object_path}" end |
- (Object) run
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/yard/server/commands/display_object_command.rb', line 6 def run return index if path.empty? if object = Registry.at(object_path) .update(:type => :layout) render(object) else self.status = 404 end end |