class ResponseMate::Exporters::Postman

Handles exporting to postman format Example output www.getpostman.com/collections/dbc0521911e45471ff4a

Attributes

environment[RW]
manifest[RW]
out[RW]
resource[RW]

Public Class Methods

new(manifest, environment, resource) click to toggle source

@param {ResponseMate::Manifest} The requests manifest @param {ResponseMate::Manifest} The requests manifest @return {Response::Mate::Exporters::Postman}

# File lib/response_mate/exporters/postman.rb, line 14
def initialize(manifest, environment, resource)
  @manifest    = manifest
  @environment = environment
  @resource    = resource
  @out = {}
end

Public Instance Methods

export() click to toggle source

Performs the export operation @return [Hash] The transformed resource

# 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