Class: Rapidoc::ResourceDoc
- Inherits:
-
Object
- Object
- Rapidoc::ResourceDoc
- Defined in:
- lib/rapidoc/resource_doc.rb
Overview
This class includes all info about a resource To extract info from controller file uses ControllerExtractor It includes an array of ActionDoc with each action information
Instance Attribute Summary collapse
-
#actions_doc ⇒ Object
readonly
Returns the value of attribute actions_doc.
-
#controller_file ⇒ Object
readonly
Returns the value of attribute controller_file.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(resource_name, routes_actions_info) ⇒ ResourceDoc
constructor
A new instance of ResourceDoc.
-
#simple_name ⇒ Object
Names with ‘/’ caracter produce problems in html ids.
Constructor Details
#initialize(resource_name, routes_actions_info) ⇒ ResourceDoc
Returns a new instance of ResourceDoc.
17 18 19 20 21 22 |
# File 'lib/rapidoc/resource_doc.rb', line 17 def initialize( resource_name, routes_actions_info ) @name = resource_name.to_s.split('/').last @controller_file = resource_name.to_s.pluralize + '_controller' + controllers_extension generate_info routes_actions_info end |
Instance Attribute Details
#actions_doc ⇒ Object (readonly)
Returns the value of attribute actions_doc.
11 12 13 |
# File 'lib/rapidoc/resource_doc.rb', line 11 def actions_doc @actions_doc end |
#controller_file ⇒ Object (readonly)
Returns the value of attribute controller_file.
11 12 13 |
# File 'lib/rapidoc/resource_doc.rb', line 11 def controller_file @controller_file end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
11 12 13 |
# File 'lib/rapidoc/resource_doc.rb', line 11 def description @description end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
11 12 13 |
# File 'lib/rapidoc/resource_doc.rb', line 11 def name @name end |
Instance Method Details
#simple_name ⇒ Object
Names with ‘/’ caracter produce problems in html ids
27 28 29 |
# File 'lib/rapidoc/resource_doc.rb', line 27 def simple_name return self.name.delete '/' end |