Class: GrapeDoc::APIDocument
- Inherits:
-
Object
- Object
- GrapeDoc::APIDocument
- Defined in:
- lib/grape_doc/api_document.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#empty ⇒ Object
Returns the value of attribute empty.
-
#http_method ⇒ Object
Returns the value of attribute http_method.
-
#params ⇒ Object
Returns the value of attribute params.
-
#path ⇒ Object
Returns the value of attribute path.
-
#resource_name ⇒ Object
Returns the value of attribute resource_name.
-
#response ⇒ Object
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(resource = nil, route = nil) ⇒ APIDocument
constructor
A new instance of APIDocument.
Constructor Details
#initialize(resource = nil, route = nil) ⇒ APIDocument
Returns a new instance of APIDocument.
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/grape_doc/api_document.rb', line 10 def initialize(resource = nil, route = nil) return if route.nil? if route.route_path == "/:version/(.:format)" self.empty = true return end self.path = route.route_path.gsub('(.:format)','') self.resource_name = resource self.http_method = route.route_method self.description = route.route_description self.params = APIParameter.initialize_parameters route.route_params self.response = nil_or_empty route.route_response end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
3 4 5 |
# File 'lib/grape_doc/api_document.rb', line 3 def description @description end |
#empty ⇒ Object
Returns the value of attribute empty.
3 4 5 |
# File 'lib/grape_doc/api_document.rb', line 3 def empty @empty end |
#http_method ⇒ Object
Returns the value of attribute http_method.
3 4 5 |
# File 'lib/grape_doc/api_document.rb', line 3 def http_method @http_method end |
#params ⇒ Object
Returns the value of attribute params.
3 4 5 |
# File 'lib/grape_doc/api_document.rb', line 3 def params @params end |
#path ⇒ Object
Returns the value of attribute path.
3 4 5 |
# File 'lib/grape_doc/api_document.rb', line 3 def path @path end |
#resource_name ⇒ Object
Returns the value of attribute resource_name.
3 4 5 |
# File 'lib/grape_doc/api_document.rb', line 3 def resource_name @resource_name end |
#response ⇒ Object
Returns the value of attribute response.
3 4 5 |
# File 'lib/grape_doc/api_document.rb', line 3 def response @response end |