lib/bel/translator/plugins/bel_script/writer.rb in bel_parser-1.0.0.alpha.22 vs lib/bel/translator/plugins/bel_script/writer.rb in bel_parser-1.0.0.alpha.23

- old
+ new

@@ -7,20 +7,20 @@ module BelScript class Writer - # Create a {Writer} object that serializes {BEL::Model::Evidence} to + # Create a {Writer} object that serializes {BEL::Nanopub::Nanopub} to # BEL Script. # - # @param [Enumerator<BEL::Model::Evidence>] data evidence data iterated + # @param [Enumerator<BEL::Nanopub::Nanopub>] data nanopubs iterated # using +each+ # @option options [Boolean] :write_header +true+ to write the BEL Script # document header; +false+ to not write the BEL Script document # header # @option options [Symbol,Module] :serialization the serialization - # technique to use for evidence; a +Module+ type will be used as + # technique to use for nanopub; a +Module+ type will be used as # is; a +Symbol+ type will be mapped as # +:discrete+ => {BelDiscreteSerialization}, # +:topdown+ => {BelTopDownSerialization}, # +:citation+ => {BelCitationSerialization}; otherwise the default # of {BelCitationSerialization} is used @@ -59,30 +59,30 @@ def each if block_given? combiner = if @streaming - BEL::Model::StreamingEvidenceCombiner.new(@data) + BEL::Nanopub::StreamingNanopubCombiner.new(@data) elsif @annotation_reference_map && @namespace_reference_map - BEL::Model::MapReferencesCombiner.new( + BEL::Nanopub::MapReferencesCombiner.new( @data, - BEL::Model::HashMapReferences.new( + BEL::Nanopub::HashMapReferences.new( @annotation_reference_map, @namespace_reference_map ) ) else - BEL::Model::BufferingEvidenceCombiner.new(@data) + BEL::Nanopub::BufferingNanopubCombiner.new(@data) end header_flag = true - combiner.each { |evidence| + combiner.each { |nanopub| - # serialize evidence - bel = to_bel(evidence) + # serialize nanopub + bel = to_bel(nanopub) if @write_header && header_flag - yield document_header(evidence.metadata.document_header) + yield document_header(nanopub.metadata.document_header) yield namespaces(combiner.namespace_references) yield annotations(combiner.annotation_references) yield <<-COMMENT.gsub(/^\s+/, '') ###############################################