Class: SimpleBioC::Node
- Inherits:
-
Object
- Object
- SimpleBioC::Node
- Defined in:
- lib/simple_bioc/node.rb
Instance Attribute Summary collapse
-
#ref ⇒ Object
readonly
Returns the value of attribute ref.
-
#refid ⇒ Object
Returns the value of attribute refid.
-
#relation ⇒ Object
readonly
Returns the value of attribute relation.
-
#role ⇒ Object
Returns the value of attribute role.
Instance Method Summary collapse
- #adjust_ref ⇒ Object
-
#initialize(parent) ⇒ Node
constructor
A new instance of Node.
- #to_c ⇒ Object
Constructor Details
#initialize(parent) ⇒ Node
Returns a new instance of Node.
6 7 8 |
# File 'lib/simple_bioc/node.rb', line 6 def initialize(parent) @relation = parent end |
Instance Attribute Details
#ref ⇒ Object (readonly)
Returns the value of attribute ref.
4 5 6 |
# File 'lib/simple_bioc/node.rb', line 4 def ref @ref end |
#refid ⇒ Object
Returns the value of attribute refid.
3 4 5 |
# File 'lib/simple_bioc/node.rb', line 3 def refid @refid end |
#relation ⇒ Object (readonly)
Returns the value of attribute relation.
4 5 6 |
# File 'lib/simple_bioc/node.rb', line 4 def relation @relation end |
#role ⇒ Object
Returns the value of attribute role.
3 4 5 |
# File 'lib/simple_bioc/node.rb', line 3 def role @role end |
Instance Method Details
#adjust_ref ⇒ Object
10 11 12 |
# File 'lib/simple_bioc/node.rb', line 10 def adjust_ref @ref = @relation.document.find_node(@refid) end |
#to_c ⇒ Object
14 15 16 |
# File 'lib/simple_bioc/node.rb', line 14 def to_c "Node @#{@refid}: #{@role})" end |