Class: BEL::Translator::Plugins::Xbel::XbelTranslator
- Inherits:
-
Object
- Object
- BEL::Translator::Plugins::Xbel::XbelTranslator
- Includes:
- BEL::Translator
- Defined in:
- lib/bel/translator/plugins/xbel/translator.rb
Instance Method Summary collapse
Instance Method Details
#read(data, options = {}) ⇒ Object
9 10 11 |
# File 'lib/bel/translator/plugins/xbel/translator.rb', line 9 def read(data, = {}) NanopubYielder.new(data, ) end |
#write(objects, writer = StringIO.new, options = {}) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/bel/translator/plugins/xbel/translator.rb', line 13 def write(objects, writer = StringIO.new, = {}) if block_given? XBELYielder.new(objects, ).each { |xml_data| yield xml_data } else if writer XBELYielder.new(objects, ).each { |xml_data| writer << xml_data writer.flush } writer else XBELYielder.new(objects, ) end end end |