Class: RailsApiBenchmark::Views::IndexMarkdown

Inherits:
View
  • Object
show all
Defined in:
lib/rails_api_benchmark/views/index_markdown.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from View

#file_name, #file_path, #folder, #render, #write

Constructor Details

#initializeIndexMarkdown

Returns a new instance of IndexMarkdown.



8
9
10
11
12
13
# File 'lib/rails_api_benchmark/views/index_markdown.rb', line 8

def initialize
  super
  @file_name = 'README'
  @routes = @config.routes
  @nb_routes = routes.count
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



6
7
8
# File 'lib/rails_api_benchmark/views/index_markdown.rb', line 6

def config
  @config
end

#nb_routesObject (readonly)

Returns the value of attribute nb_routes.



6
7
8
# File 'lib/rails_api_benchmark/views/index_markdown.rb', line 6

def nb_routes
  @nb_routes
end

#routesObject (readonly)

Returns the value of attribute routes.



6
7
8
# File 'lib/rails_api_benchmark/views/index_markdown.rb', line 6

def routes
  @routes
end

Instance Method Details

#extensionObject

Maybe put this in a superclass like MarkdownView to DRY



16
17
18
# File 'lib/rails_api_benchmark/views/index_markdown.rb', line 16

def extension
  'md'
end