Class: Graph::Thingy
Overview
You know… THINGY!
Has a pointer back to its graph parent and attributes.
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#graph ⇒ Object
Returns the value of attribute graph.
Instance Method Summary collapse
-
#attributes? ⇒ Boolean
Does this thing have attributes?.
-
#initialize(graph) ⇒ Thingy
constructor
:nodoc:.
-
#initialize_copy(other) ⇒ Object
:nodoc:.
-
#label(name) ⇒ Object
Shortcut method to set the label attribute.
Constructor Details
#initialize(graph) ⇒ Thingy
:nodoc:
498 499 500 |
# File 'lib/graph.rb', line 498 def initialize graph # :nodoc: super graph, [] end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes
497 498 499 |
# File 'lib/graph.rb', line 497 def attributes @attributes end |
#graph ⇒ Object
Returns the value of attribute graph
497 498 499 |
# File 'lib/graph.rb', line 497 def graph @graph end |
Instance Method Details
#attributes? ⇒ Boolean
Does this thing have attributes?
519 520 521 |
# File 'lib/graph.rb', line 519 def attributes? not self.attributes.empty? end |
#initialize_copy(other) ⇒ Object
:nodoc:
502 503 504 505 |
# File 'lib/graph.rb', line 502 def initialize_copy other # :nodoc: super self.attributes = other.attributes.dup end |
#label(name) ⇒ Object
Shortcut method to set the label attribute.
510 511 512 513 514 |
# File 'lib/graph.rb', line 510 def label name attributes.reject! { |s| s =~ /^label =/ } attributes << "label = #{Graph.escape_label name}" self end |