Class: Jsonapi::Generators::SwaggerBlocksGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/jsonapi/swagger_blocks_generator.rb

Instance Method Summary collapse

Instance Method Details

#generate_documentationObject



10
11
12
13
14
15
16
17
# File 'lib/generators/jsonapi/swagger_blocks_generator.rb', line 10

def generate_documentation
  model_name = model.to_s.split("::").last || model
  Object.const_get("#{namespace}::#{model_name.camelcase}Resource").is_a?(Class)
  generate_model_template
  generate_controller_template
rescue Exception => e
  p e.message
end