Class: SwaggerDocsGenerator::Parser Abstract
- Inherits:
-
Object
- Object
- SwaggerDocsGenerator::Parser
- Defined in:
- lib/swagger_docs_generator/parser/parser.rb
Overview
This class is abstract.
Classes for parsing Rails classes
# Parse classes
Direct Known Subclasses
Instance Attribute Summary collapse
-
#controller ⇒ Object
readonly
It’s a name of controller parsed.
-
#path ⇒ Object
readonly
It’s a path to temporary file.
-
#version ⇒ Object
readonly
It’s a version to API documentation parsed.
Instance Method Summary collapse
- #controller_file ⇒ Object
-
#initialize(controller) ⇒ Parser
constructor
A new instance of Parser.
Constructor Details
#initialize(controller) ⇒ Parser
Returns a new instance of Parser.
17 18 19 20 21 |
# File 'lib/swagger_docs_generator/parser/parser.rb', line 17 def initialize(controller) @controller = controller @path = File.join(Dir.pwd, 'public') @version = SwaggerDocsGenerator.configure_info.version end |
Instance Attribute Details
#controller ⇒ Object (readonly)
It’s a name of controller parsed
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/swagger_docs_generator/parser/parser.rb', line 14 class Parser attr_reader :controller, :path, :version def initialize(controller) @controller = controller @path = File.join(Dir.pwd, 'public') @version = SwaggerDocsGenerator.configure_info.version end def controller_file File.join(@path, @version, "#{controller_name}.json") end private def controller_name @controller.controller_name end end |
#path ⇒ Object (readonly)
It’s a path to temporary file
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/swagger_docs_generator/parser/parser.rb', line 14 class Parser attr_reader :controller, :path, :version def initialize(controller) @controller = controller @path = File.join(Dir.pwd, 'public') @version = SwaggerDocsGenerator.configure_info.version end def controller_file File.join(@path, @version, "#{controller_name}.json") end private def controller_name @controller.controller_name end end |
#version ⇒ Object (readonly)
It’s a version to API documentation parsed
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/swagger_docs_generator/parser/parser.rb', line 14 class Parser attr_reader :controller, :path, :version def initialize(controller) @controller = controller @path = File.join(Dir.pwd, 'public') @version = SwaggerDocsGenerator.configure_info.version end def controller_file File.join(@path, @version, "#{controller_name}.json") end private def controller_name @controller.controller_name end end |
Instance Method Details
#controller_file ⇒ Object
23 24 25 |
# File 'lib/swagger_docs_generator/parser/parser.rb', line 23 def controller_file File.join(@path, @version, "#{controller_name}.json") end |