Class: BEL::Translator::Plugins::Xbel::NanopubYielder

Inherits:
Object
  • Object
show all
Defined in:
lib/bel/translator/plugins/xbel/nanopub_yielder.rb

Instance Method Summary collapse

Constructor Details

#initialize(io, options = {}) ⇒ NanopubYielder

Returns a new instance of NanopubYielder.



10
11
12
# File 'lib/bel/translator/plugins/xbel/nanopub_yielder.rb', line 10

def initialize(io, options = {})
  @io = io
end

Instance Method Details

#each(&block) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/bel/translator/plugins/xbel/nanopub_yielder.rb', line 14

def each(&block)
  if block_given?
    handler = NanopubHandler.new(block)
    REXML::Document.parse_stream(@io, handler)
  else
    to_enum(:each)
  end
end