Class: YARD::Server::Commands::LibraryCommand Abstract
- Inherits:
-
Base
- Object
- Base
- YARD::Server::Commands::LibraryCommand
- Defined in:
- lib/yard/server/commands/library_command.rb
Overview
This is the base command for all commands that deal directly with libraries. Some commands do not, but most (like DisplayObjectCommand) do. If your command deals with libraries directly, subclass this class instead. See Base for notes on how to subclass a command.
Direct Known Subclasses
DisplayFileCommand, DisplayObjectCommand, ListCommand, SearchCommand
Instance Attribute Summary (collapse)
-
- (Boolean) incremental
Whether to reparse data.
-
- (LibraryVersion) library
The object containing library information.
-
- (Hash{Symbol => Object}) options
Default options for the library.
-
- (Serializers::Base) serializer
The serializer used to perform file linking.
-
- (Boolean) single_library
Whether router should route for multiple libraries.
Attributes inherited from Base
adapter, body, caching, command_options, headers, path, request, status
Instance Method Summary (collapse)
- - (Object) call(request)
-
- (LibraryCommand) initialize(opts = {})
constructor
A new instance of LibraryCommand.
Methods inherited from Base
#cache, #not_found, #redirect, #render, #run
Constructor Details
- (LibraryCommand) initialize(opts = {})
A new instance of LibraryCommand
32 33 34 35 |
# File 'lib/yard/server/commands/library_command.rb', line 32 def initialize(opts = {}) super self.serializer = DocServerSerializer.new(self) end |
Instance Attribute Details
- (Boolean) incremental
Whether to reparse data
26 27 28 |
# File 'lib/yard/server/commands/library_command.rb', line 26 def incremental @incremental end |
- (LibraryVersion) library
The object containing library information
14 15 16 |
# File 'lib/yard/server/commands/library_command.rb', line 14 def library @library end |
- (Hash{Symbol => Object}) options
Default options for the library
17 18 19 |
# File 'lib/yard/server/commands/library_command.rb', line 17 def @options end |
- (Serializers::Base) serializer
The serializer used to perform file linking
20 21 22 |
# File 'lib/yard/server/commands/library_command.rb', line 20 def serializer @serializer end |
- (Boolean) single_library
Whether router should route for multiple libraries
23 24 25 |
# File 'lib/yard/server/commands/library_command.rb', line 23 def single_library @single_library end |
Instance Method Details
- (Object) call(request)
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/yard/server/commands/library_command.rb', line 37 def call(request) self.request = request self. = SymbolHash.new(false).update( :serialize => false, :serializer => serializer, :library => library, :adapter => adapter, :single_library => single_library, :markup => :rdoc, :format => :html ) setup_library super rescue LibraryNotPreparedError not_prepared end |