Class: Vertex
Class Attribute Summary collapse
-
.color_width ⇒ Object
Returns the value of attribute color_width.
-
.hue ⇒ Object
Returns the value of attribute hue.
-
.max_dist ⇒ Object
Returns the value of attribute max_dist.
Instance Attribute Summary collapse
-
#dist ⇒ Object
Returns the value of attribute dist.
-
#i ⇒ Object
Returns the value of attribute i.
-
#id ⇒ Object
Sets the attribute id.
-
#j ⇒ Object
Returns the value of attribute j.
-
#label ⇒ Object
(also: #to_s)
Returns the value of attribute label.
-
#marked ⇒ Object
Returns the value of attribute marked.
Instance Method Summary collapse
Methods included from Colorizeable
Class Attribute Details
.color_width ⇒ Object
Returns the value of attribute color_width.
14 15 16 |
# File 'lib/vertex.rb', line 14 def color_width @color_width end |
.hue ⇒ Object
Returns the value of attribute hue.
14 15 16 |
# File 'lib/vertex.rb', line 14 def hue @hue end |
.max_dist ⇒ Object
Returns the value of attribute max_dist.
14 15 16 |
# File 'lib/vertex.rb', line 14 def max_dist @max_dist end |
Instance Attribute Details
#dist ⇒ Object
Returns the value of attribute dist.
5 6 7 |
# File 'lib/vertex.rb', line 5 def dist @dist end |
#i ⇒ Object
Returns the value of attribute i.
5 6 7 |
# File 'lib/vertex.rb', line 5 def i @i end |
#id=(value) ⇒ Object
Sets the attribute id
5 6 7 |
# File 'lib/vertex.rb', line 5 def id=(value) @id = value end |
#j ⇒ Object
Returns the value of attribute j.
5 6 7 |
# File 'lib/vertex.rb', line 5 def j @j end |
#label ⇒ Object Also known as: to_s
Returns the value of attribute label.
5 6 7 |
# File 'lib/vertex.rb', line 5 def label @label end |
#marked ⇒ Object
Returns the value of attribute marked.
5 6 7 |
# File 'lib/vertex.rb', line 5 def marked @marked end |
Instance Method Details
#char ⇒ Object
26 27 28 |
# File 'lib/vertex.rb', line 26 def char dist.to_s.chars.last end |
#mark(dist: 0) ⇒ Object
21 22 23 24 |
# File 'lib/vertex.rb', line 21 def mark(dist: 0) @marked = true @dist = dist end |
#marked? ⇒ Boolean
17 18 19 |
# File 'lib/vertex.rb', line 17 def marked? marked end |
#reset ⇒ Object
30 31 32 33 |
# File 'lib/vertex.rb', line 30 def reset @marked = false @dist = 0 end |