Class: ApiSketch::Generators::Bootstrap

Inherits:
Base
  • Object
show all
Defined in:
lib/api_sketch/generators/bootstrap.rb

Instance Attribute Summary

Attributes inherited from Base

#definitions_dir, #documentation_dir, #templates_folder

Instance Method Summary collapse

Methods inherited from Base

#generate!

Constructor Details

#initialize(options = {}) ⇒ Bootstrap

Generated folders structure is

docs - html folders and files
assets - js, css and images. Html styling


8
9
10
11
# File 'lib/api_sketch/generators/bootstrap.rb', line 8

def initialize(options = {})
  super(options)
  @resource_template = ERB.new(File.read("#{self.templates_folder}/resource.html.erb"))
end

Instance Method Details

#filename_for(resource) ⇒ Object

This is defined here because it is related for this type of generator only



14
15
16
# File 'lib/api_sketch/generators/bootstrap.rb', line 14

def filename_for(resource)
  resource.id + '.html'
end