Class: YARD::Server::Commands::LibraryCommand Abstract
- 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
-
#incremental ⇒ Boolean
Whether to reparse data.
-
#library ⇒ LibraryVersion
The object containing library information.
-
#options ⇒ Hash{Symbol => Object}
Default options for the library.
-
#serializer ⇒ Serializers::Base
The serializer used to perform file linking.
-
#single_library ⇒ Boolean
Whether router should route for multiple libraries.
Attributes inherited from Base
#adapter, #body, #caching, #command_options, #headers, #path, #request, #status
Instance Method Summary collapse
- #call(request) ⇒ Object
-
#initialize(opts = {}) ⇒ LibraryCommand
constructor
A new instance of LibraryCommand.
Methods inherited from Base
#cache, #not_found, #redirect, #render, #run
Constructor Details
#initialize(opts = {}) ⇒ LibraryCommand
Returns a new instance of LibraryCommand.
30 31 32 33 |
# File 'lib/yard/server/commands/library_command.rb', line 30 def initialize(opts = {}) super self.serializer = DocServerSerializer.new(self) end |
Instance Attribute Details
#incremental ⇒ Boolean
Returns whether to reparse data.
24 25 26 |
# File 'lib/yard/server/commands/library_command.rb', line 24 def incremental @incremental end |
#library ⇒ LibraryVersion
Returns the object containing library information.
12 13 14 |
# File 'lib/yard/server/commands/library_command.rb', line 12 def library @library end |
#options ⇒ Hash{Symbol => Object}
Returns default options for the library.
15 16 17 |
# File 'lib/yard/server/commands/library_command.rb', line 15 def @options end |
#serializer ⇒ Serializers::Base
Returns the serializer used to perform file linking.
18 19 20 |
# File 'lib/yard/server/commands/library_command.rb', line 18 def serializer @serializer end |
#single_library ⇒ Boolean
Returns whether router should route for multiple libraries.
21 22 23 |
# File 'lib/yard/server/commands/library_command.rb', line 21 def single_library @single_library end |
Instance Method Details
#call(request) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/yard/server/commands/library_command.rb', line 35 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 |