Class: BEL::Translator::Plugins::BelScript::BelScriptTranslator
- Inherits:
-
Object
- Object
- BEL::Translator::Plugins::BelScript::BelScriptTranslator
- Includes:
- BEL::Translator
- Defined in:
- lib/bel/translator/plugins/bel_script/translator.rb
Overview
BelScriptTranslator defines a BEL::Translator that can read/write BEL Script using the Nanopub model.
Instance Method Summary collapse
Instance Method Details
#read(data, options = {}) ⇒ Object
14 15 16 |
# File 'lib/bel/translator/plugins/bel_script/translator.rb', line 14 def read(data, = {}) Reader.new(data, ) end |
#write(objects, writer = StringIO.new, options = {}) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/bel/translator/plugins/bel_script/translator.rb', line 18 def write(objects, writer = StringIO.new, = {}) if block_given? Writer.new(objects, ).each { |bel_part| yield bel_part } else if writer Writer.new(objects, ).each { |bel_part| writer << "#{bel_part}" writer.flush } writer else Writer.new(objects, ) end end end |