Class: BEL::Nanopub::StreamingNanopubCombiner

Inherits:
Object
  • Object
show all
Defined in:
lib/bel/nanopub/streaming_nanopub_combiner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(nanopub_collection) ⇒ StreamingNanopubCombiner

Returns a new instance of StreamingNanopubCombiner.



8
9
10
# File 'lib/bel/nanopub/streaming_nanopub_combiner.rb', line 8

def initialize(nanopub_collection)
  @nanopub_collection = nanopub_collection
end

Instance Attribute Details

#annotation_referencesObject (readonly)

Returns the value of attribute annotation_references.



6
7
8
# File 'lib/bel/nanopub/streaming_nanopub_combiner.rb', line 6

def annotation_references
  @annotation_references
end

#namespace_referencesObject (readonly)

Returns the value of attribute namespace_references.



6
7
8
# File 'lib/bel/nanopub/streaming_nanopub_combiner.rb', line 6

def namespace_references
  @namespace_references
end

Instance Method Details

#eachObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/bel/nanopub/streaming_nanopub_combiner.rb', line 12

def each
  if block_given?
    @nanopub_collection.each do |nanopub|
      once {
        @annotation_references = nanopub.references.annotations
        @namespace_references  = nanopub.references.namespaces
      }

      yield nanopub
    end
  else
    to_enum(:each)
  end
end