Class: SwaggerDocsGenerator::Model

Inherits:
Object
  • Object
show all
Defined in:
lib/swagger_docs_generator/parser/model.rb

Overview

Parser models

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(controller) ⇒ Model

Returns a new instance of Model.



8
9
10
11
12
13
14
15
# File 'lib/swagger_docs_generator/parser/model.rb', line 8

def initialize(controller)
  @name = controller.controller_name.singularize.camelize
  @orm = if defined?(Mongoid)
           ModelMongo.new(name)
         else
           ModelActiveRecord.new(name)
         end
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/swagger_docs_generator/parser/model.rb', line 6

def name
  @name
end

Instance Method Details

#attribute_propertiesObject



17
18
19
# File 'lib/swagger_docs_generator/parser/model.rb', line 17

def attribute_properties
  @orm.attribute_properties
end