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

Constructor Details

#initialize(routes) ⇒ IndexMarkdown

Returns a new instance of IndexMarkdown.



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

def initialize(routes)
  super
  @file_name = 'README'
  @config = RailsApiBenchmark.config.all
  @routes = 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



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

def extension
  'md'
end