Class: GFA::GraphVertex
- Inherits:
-
Object
- Object
- GFA::GraphVertex
- Defined in:
- lib/gfa/graph.rb
Overview
:nodoc:
Constant Summary collapse
- @@idx =
Class-level
{}
Instance Attribute Summary collapse
-
#segment ⇒ Object
readonly
Instance-level.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(segment, orient) ⇒ GraphVertex
constructor
A new instance of GraphVertex.
- #to_s ⇒ Object
Constructor Details
#initialize(segment, orient) ⇒ GraphVertex
Returns a new instance of GraphVertex.
255 256 257 258 259 |
# File 'lib/gfa/graph.rb', line 255 def initialize(segment, orient) @segment = segment.is_a?(GFA::Record::Segment) ? segment.name.value : segment.is_a?(GFA::Field) ? segment.value : segment @orient = orient.is_a?(GFA::Field) ? orient.value : orient end |
Instance Attribute Details
#segment ⇒ Object (readonly)
Instance-level
253 254 255 |
# File 'lib/gfa/graph.rb', line 253 def segment @segment end |
Class Method Details
.idx(segment, orient) ⇒ Object
246 247 248 249 250 |
# File 'lib/gfa/graph.rb', line 246 def self.idx(segment, orient) n = GFA::GraphVertex.new(segment, orient) @@idx[n.to_s] ||= n @@idx[n.to_s] end |
Instance Method Details
#to_s ⇒ Object
261 262 263 |
# File 'lib/gfa/graph.rb', line 261 def to_s "#{segment}#{orient}" end |