Method: YARD::Server::Router#route_docs

Defined in:
lib/yard/server/router.rb

#route_docs(library, paths) ⇒ Array(Numeric,Hash,Array<String>)? (protected)

Routes requests from #docs_prefix and calls the appropriate command

Parameters:

Returns:

Since:

  • 0.6.0


122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'lib/yard/server/router.rb', line 122

def route_docs(library, paths)
  return route_index if library.nil?
  case paths.first
  when "frames"
    paths.shift
    cmd = FramesCommand
  when "file"
    paths.shift
    cmd = DisplayFileCommand
  else
    cmd = DisplayObjectCommand
  end
  cmd = cmd.new(final_options(library, paths))
  cmd.call(request)
end