Class: SwaggerDocsGenerator::Model
- Inherits:
-
Object
- Object
- SwaggerDocsGenerator::Model
- Defined in:
- lib/swagger_docs_generator/parser/model.rb
Overview
Parser models
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #attribute_properties ⇒ Object
-
#initialize(controller) ⇒ Model
constructor
A new instance of Model.
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
#name ⇒ Object (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_properties ⇒ Object
17 18 19 |
# File 'lib/swagger_docs_generator/parser/model.rb', line 17 def attribute_properties @orm.attribute_properties end |