Class: Rapidoc::ActionDoc
- Inherits:
-
Object
- Object
- Rapidoc::ActionDoc
- Defined in:
- lib/rapidoc/action_doc.rb
Overview
This class save information about action of resource.
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#action_method ⇒ Object
readonly
Returns the value of attribute action_method.
-
#authentication ⇒ Object
readonly
Returns the value of attribute authentication.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#example_req ⇒ Object
readonly
Returns the value of attribute example_req.
-
#example_res ⇒ Object
readonly
Returns the value of attribute example_res.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#http_responses ⇒ Object
readonly
Returns the value of attribute http_responses.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
-
#resource_name ⇒ Object
readonly
Returns the value of attribute resource_name.
-
#response_formats ⇒ Object
readonly
Returns the value of attribute response_formats.
-
#urls ⇒ Object
readonly
Returns the value of attribute urls.
Instance Method Summary collapse
- #has_controller_info ⇒ Object
-
#initialize(routes_info, controller_info, examples_route) ⇒ ActionDoc
constructor
A new instance of ActionDoc.
Constructor Details
#initialize(routes_info, controller_info, examples_route) ⇒ ActionDoc
Returns a new instance of ActionDoc.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/rapidoc/action_doc.rb', line 21 def initialize( routes_info, controller_info, examples_route ) @resource_name = routes_info[:resource].split('/').last @resource = routes_info[:resource].to_s @action = routes_info[:action].to_s @action_method = routes_info[:method].to_s || '-----' @urls = routes_info[:urls] @file = @resource + '/' + @action puts " - Generating #{@action} action documentation..." if trace? add_controller_info( controller_info ) if controller_info load_examples( examples_route ) if examples_route load_params_errors if default_errors? @action and @params end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
12 13 14 |
# File 'lib/rapidoc/action_doc.rb', line 12 def action @action end |
#action_method ⇒ Object (readonly)
Returns the value of attribute action_method.
12 13 14 |
# File 'lib/rapidoc/action_doc.rb', line 12 def action_method @action_method end |
#authentication ⇒ Object (readonly)
Returns the value of attribute authentication.
12 13 14 |
# File 'lib/rapidoc/action_doc.rb', line 12 def authentication @authentication end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
12 13 14 |
# File 'lib/rapidoc/action_doc.rb', line 12 def description @description end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
12 13 14 |
# File 'lib/rapidoc/action_doc.rb', line 12 def errors @errors end |
#example_req ⇒ Object (readonly)
Returns the value of attribute example_req.
12 13 14 |
# File 'lib/rapidoc/action_doc.rb', line 12 def example_req @example_req end |
#example_res ⇒ Object (readonly)
Returns the value of attribute example_res.
12 13 14 |
# File 'lib/rapidoc/action_doc.rb', line 12 def example_res @example_res end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
12 13 14 |
# File 'lib/rapidoc/action_doc.rb', line 12 def file @file end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
12 13 14 |
# File 'lib/rapidoc/action_doc.rb', line 12 def headers @headers end |
#http_responses ⇒ Object (readonly)
Returns the value of attribute http_responses.
12 13 14 |
# File 'lib/rapidoc/action_doc.rb', line 12 def http_responses @http_responses end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
12 13 14 |
# File 'lib/rapidoc/action_doc.rb', line 12 def params @params end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
12 13 14 |
# File 'lib/rapidoc/action_doc.rb', line 12 def resource @resource end |
#resource_name ⇒ Object (readonly)
Returns the value of attribute resource_name.
12 13 14 |
# File 'lib/rapidoc/action_doc.rb', line 12 def resource_name @resource_name end |
#response_formats ⇒ Object (readonly)
Returns the value of attribute response_formats.
12 13 14 |
# File 'lib/rapidoc/action_doc.rb', line 12 def response_formats @response_formats end |
#urls ⇒ Object (readonly)
Returns the value of attribute urls.
12 13 14 |
# File 'lib/rapidoc/action_doc.rb', line 12 def urls @urls end |
Instance Method Details
#has_controller_info ⇒ Object
36 37 38 |
# File 'lib/rapidoc/action_doc.rb', line 36 def has_controller_info @controller_info ? true : false end |