Class: SimpleBioC::Node

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#refObject (readonly)

Returns the value of attribute ref.



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

def ref
  @ref
end

#refidObject

Returns the value of attribute refid.



3
4
5
# File 'lib/simple_bioc/node.rb', line 3

def refid
  @refid
end

#relationObject (readonly)

Returns the value of attribute relation.



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

def relation
  @relation
end

#roleObject

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_refObject



10
11
12
# File 'lib/simple_bioc/node.rb', line 10

def adjust_ref
  @ref = relation.document.find_node(refid)
end

#to_cObject



14
15
16
# File 'lib/simple_bioc/node.rb', line 14

def to_c
  "Node @#{refid}: #{role})"
end