Method: YARD::Server::Commands::Base#call
- Defined in:
- lib/yard/server/commands/base.rb
permalink #call(request) ⇒ Array(Numeric,Hash,Array<String>)
Note:
This command should not be overridden by subclasses. Implement the callback method #run instead.
The main method called by a router with a request object.
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/yard/server/commands/base.rb', line 88 def call(request) self.request = request self.path ||= request.path[1..-1] self.headers = {'Content-Type' => 'text/html'} self.body = '' self.status = 200 begin run rescue FinishRequest rescue NotFoundError => e self.body = e. if e. != e.class.to_s self.status = 404 end not_found if status == 404 [status, headers, body.is_a?(Array) ? body : [body]] end |