Class: ResponseMate::Exporters::Postman
- Inherits:
-
Object
- Object
- ResponseMate::Exporters::Postman
- Defined in:
- lib/response_mate/exporters/postman.rb,
lib/response_mate/exporters/postman/collection.rb,
lib/response_mate/exporters/postman/environment.rb
Overview
Handles exporting to postman format Example output www.getpostman.com/collections/dbc0521911e45471ff4a
Defined Under Namespace
Classes: Collection, Environment
Instance Attribute Summary collapse
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#manifest ⇒ Object
Returns the value of attribute manifest.
-
#out ⇒ Object
Returns the value of attribute out.
-
#resource ⇒ Object
Returns the value of attribute resource.
Instance Method Summary collapse
-
#export ⇒ Hash
Performs the export operation.
- #initialize(manifest, environment, resource) ⇒ Response::Mate::Exporters::Postman constructor
Constructor Details
#initialize(manifest, environment, resource) ⇒ Response::Mate::Exporters::Postman
14 15 16 17 18 19 |
# File 'lib/response_mate/exporters/postman.rb', line 14 def initialize(manifest, environment, resource) @manifest = manifest @environment = environment @resource = resource @out = {} end |
Instance Attribute Details
#environment ⇒ Object
Returns the value of attribute environment.
9 10 11 |
# File 'lib/response_mate/exporters/postman.rb', line 9 def environment @environment end |
#manifest ⇒ Object
Returns the value of attribute manifest.
9 10 11 |
# File 'lib/response_mate/exporters/postman.rb', line 9 def manifest @manifest end |
#out ⇒ Object
Returns the value of attribute out.
9 10 11 |
# File 'lib/response_mate/exporters/postman.rb', line 9 def out @out end |
#resource ⇒ Object
Returns the value of attribute resource.
9 10 11 |
# File 'lib/response_mate/exporters/postman.rb', line 9 def resource @resource end |
Instance Method Details
#export ⇒ Hash
Performs the export operation
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/response_mate/exporters/postman.rb', line 23 def export case resource when 'manifest' ResponseMate::Exporters::Postman::Collection.new(manifest).export when 'environment' ResponseMate::Exporters::Postman::Environment.new(environment).export else fail 'Unsupported resource' end end |