Class: SimpleBioC::NodeBase

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_bioc/node_base.rb

Overview

NodeBase is not a BioC DTD entity. This is a super class of Annotation & Relation.

Direct Known Subclasses

Annotation, Relation

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parent) ⇒ NodeBase

Returns a new instance of NodeBase.



7
8
9
10
11
12
13
14
15
# File 'lib/simple_bioc/node_base.rb', line 7

def initialize(parent)
  @infons = {}
  @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

Instance Attribute Details

#documentObject (readonly)

Returns the value of attribute document.



5
6
7
# File 'lib/simple_bioc/node_base.rb', line 5

def document
  @document
end

#idObject

Returns the value of attribute id.



4
5
6
# File 'lib/simple_bioc/node_base.rb', line 4

def id
  @id
end

#infonsObject

Returns the value of attribute infons.



4
5
6
# File 'lib/simple_bioc/node_base.rb', line 4

def infons
  @infons
end

#passageObject (readonly)

Returns the value of attribute passage.



5
6
7
# File 'lib/simple_bioc/node_base.rb', line 5

def passage
  @passage
end

#sentenceObject (readonly)

Returns the value of attribute sentence.



5
6
7
# File 'lib/simple_bioc/node_base.rb', line 5

def sentence
  @sentence
end