Class: PostmanDocGenerator
- Inherits:
-
Object
- Object
- PostmanDocGenerator
- Defined in:
- lib/postman_doc_generator.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
Returns the value of attribute error.
-
#result ⇒ Object
Returns the value of attribute result.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(http_method, path, controller, response) ⇒ PostmanDocGenerator
constructor
A new instance of PostmanDocGenerator.
Constructor Details
#initialize(http_method, path, controller, response) ⇒ PostmanDocGenerator
Returns a new instance of PostmanDocGenerator.
18 19 20 21 22 23 24 |
# File 'lib/postman_doc_generator.rb', line 18 def initialize(http_method, path, controller, response) @sample_dir = "#{File.("#{File.dirname(__FILE__)}/..")}/sample" @http_method = http_method.upcase.to_s @path = path @controller = controller @response = response end |
Instance Attribute Details
#error ⇒ Object
Returns the value of attribute error.
5 6 7 |
# File 'lib/postman_doc_generator.rb', line 5 def error @error end |
#result ⇒ Object
Returns the value of attribute result.
5 6 7 |
# File 'lib/postman_doc_generator.rb', line 5 def result @result end |
Class Method Details
.start(http_method, path, controller, response) ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/postman_doc_generator.rb', line 8 def start(http_method, path, controller, response) generator = new(http_method, path, controller, response) generator.call rescue => e generator.error = e ensure generator end |
Instance Method Details
#call ⇒ Object
26 27 28 29 30 31 |
# File 'lib/postman_doc_generator.rb', line 26 def call get_basic_setting setup_basic_info setup_postman_json save_to_file end |