Module: WeakSwaggerParameters::Model::ClassMethods
- Defined in:
- lib/weak_swagger_parameters/model.rb
Instance Method Summary collapse
- #add_to_doc_section(doc_section) ⇒ Object
- #docs_model_name ⇒ Object
- #in_doc_section?(doc_section) ⇒ Boolean
- #model(&block) ⇒ Object
- #wsp_node ⇒ Object
Instance Method Details
#add_to_doc_section(doc_section) ⇒ Object
8 9 10 11 |
# File 'lib/weak_swagger_parameters/model.rb', line 8 def add_to_doc_section(doc_section) @doc_sections ||= [] @doc_sections << doc_section end |
#docs_model_name ⇒ Object
26 27 28 |
# File 'lib/weak_swagger_parameters/model.rb', line 26 def docs_model_name name.split('::').join('_') end |
#in_doc_section?(doc_section) ⇒ Boolean
13 14 15 |
# File 'lib/weak_swagger_parameters/model.rb', line 13 def in_doc_section?(doc_section) (@doc_sections || []).include?(doc_section) end |
#model(&block) ⇒ Object
17 18 19 20 |
# File 'lib/weak_swagger_parameters/model.rb', line 17 def model(&block) @wsp_node = WeakSwaggerParameters::Definitions::Model.new(docs_model_name, &block) @wsp_node.apply_docs(self) end |
#wsp_node ⇒ Object
22 23 24 |
# File 'lib/weak_swagger_parameters/model.rb', line 22 def wsp_node @wsp_node end |