Class: SimpleBioC::NodeBase
- Inherits:
-
Object
- Object
- SimpleBioC::NodeBase
- 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
Instance Attribute Summary collapse
-
#document ⇒ Object
readonly
Returns the value of attribute document.
-
#id ⇒ Object
Returns the value of attribute id.
-
#infons ⇒ Object
Returns the value of attribute infons.
-
#passage ⇒ Object
readonly
Returns the value of attribute passage.
-
#sentence ⇒ Object
readonly
Returns the value of attribute sentence.
Instance Method Summary collapse
- #clear_sentence ⇒ Object
-
#initialize(parent) ⇒ NodeBase
constructor
A new instance of NodeBase.
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
#document ⇒ Object (readonly)
Returns the value of attribute document.
5 6 7 |
# File 'lib/simple_bioc/node_base.rb', line 5 def document @document end |
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/simple_bioc/node_base.rb', line 4 def id @id end |
#infons ⇒ Object
Returns the value of attribute infons.
4 5 6 |
# File 'lib/simple_bioc/node_base.rb', line 4 def infons @infons end |
#passage ⇒ Object (readonly)
Returns the value of attribute passage.
5 6 7 |
# File 'lib/simple_bioc/node_base.rb', line 5 def passage @passage end |
#sentence ⇒ Object (readonly)
Returns the value of attribute sentence.
5 6 7 |
# File 'lib/simple_bioc/node_base.rb', line 5 def sentence @sentence end |
Instance Method Details
#clear_sentence ⇒ Object
17 18 19 |
# File 'lib/simple_bioc/node_base.rb', line 17 def clear_sentence @sentence = nil end |