Class: Fictium::Postman::V2Exporter

Inherits:
Object
  • Object
show all
Defined in:
lib/fictium/exporters/postman/v2_exporter.rb,
lib/fictium/exporters/postman/v2_exporter/body_formatter.rb,
lib/fictium/exporters/postman/v2_exporter/info_formatter.rb,
lib/fictium/exporters/postman/v2_exporter/item_formatter.rb,
lib/fictium/exporters/postman/v2_exporter/action_formatter.rb,
lib/fictium/exporters/postman/v2_exporter/folder_formatter.rb,
lib/fictium/exporters/postman/v2_exporter/header_formatter.rb,
lib/fictium/exporters/postman/v2_exporter/request_formatter.rb,
lib/fictium/exporters/postman/v2_exporter/metadata_formatter.rb,
lib/fictium/exporters/postman/v2_exporter/response_formatter.rb

Defined Under Namespace

Classes: ActionFormatter, BodyFormatter, FolderFormatter, HeaderFormatter, InfoFormatter, ItemFormatter, MetadataFormatter, RequestFormatter, ResponseFormatter

Instance Method Summary collapse

Instance Method Details

#export(document) ⇒ Object



17
18
19
20
21
22
# File 'lib/fictium/exporters/postman/v2_exporter.rb', line 17

def export(document)
  result = format_document(document)
  validate!(result)
  FileUtils.mkdir_p(File.dirname(export_file))
  File.write(export_file, pretty_print? ? JSON.pretty_generate(result) : result.to_json)
end