Sha256: 5bb645ae8cebb6dbd1cf22785794c1c6123eb3c6f1123ed89bd02acb46d97ac6

Contents?: true

Size: 599 Bytes

Versions: 8

Compression:

Stored size: 599 Bytes

Contents

module SimpleBioC
  # NodeBase is not a BioC DTD entity. This is a super class of Annotation & Relation.
  class NodeBase
    attr_accessor :id, :infons
    attr_reader :document, :passage, :sentence

    def initialize(parent)
      @infons = {}
      @id = nil
      @document = parent if parent.is_a? Document
      @passage  = parent if parent.is_a? Passage
      @sentence = parent if parent.is_a? Sentence 
      @passage  = @sentence.passage unless @sentence.nil?
      @document = @passage.document unless @passage.nil?
    end

    def clear_sentence
      @sentence = nil
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
simple_bioc-0.0.24 lib/simple_bioc/node_base.rb
simple_bioc-0.0.23 lib/simple_bioc/node_base.rb
simple_bioc-0.0.22 lib/simple_bioc/node_base.rb
simple_bioc-0.0.21 lib/simple_bioc/node_base.rb
simple_bioc-0.0.20 lib/simple_bioc/node_base.rb
simple_bioc-0.0.19 lib/simple_bioc/node_base.rb
simple_bioc-0.0.18 lib/simple_bioc/node_base.rb
simple_bioc-0.0.17 lib/simple_bioc/node_base.rb