Class: Grape::Apidoc

Inherits:
Object
  • Object
show all
Defined in:
lib/grape/apidoc.rb

Defined Under Namespace

Classes: RakeTask, TableFormat

Constant Summary collapse

ENTITY_FIELDS_TABLE =

Field, Type, Description, Values

TableFormat.new([20, 10, 30, 10]).freeze
ROUTE_FIELDS_TABLE =

Field, Type, Description

TableFormat.new([20, 10, 40]).freeze

Instance Method Summary collapse

Constructor Details

#initialize(root_api_class = nil, output: $stdout) ⇒ Apidoc

Returns a new instance of Apidoc.



9
10
11
12
# File 'lib/grape/apidoc.rb', line 9

def initialize(root_api_class = nil, output: $stdout)
  @api = root_api_class || detect_root_api_class
  @out = output
end

Instance Method Details

#write!Object



14
15
16
17
# File 'lib/grape/apidoc.rb', line 14

def write!
  write_entities! if defined?(Grape::Entity)
  write_routes!
end