Class: Graph::CompoundAttribute
- Defined in:
- lib/graph.rb
Instance Attribute Summary
Attributes inherited from Attribute
Instance Method Summary collapse
- #<<(thing) ⇒ Object
-
#initialize(attr = []) ⇒ CompoundAttribute
constructor
A new instance of CompoundAttribute.
- #push(attrib) ⇒ Object
- #to_s ⇒ Object
Methods inherited from Attribute
Constructor Details
#initialize(attr = []) ⇒ CompoundAttribute
Returns a new instance of CompoundAttribute.
412 413 414 |
# File 'lib/graph.rb', line 412 def initialize attr = [] super end |
Instance Method Details
#<<(thing) ⇒ Object
420 421 422 423 424 425 |
# File 'lib/graph.rb', line 420 def << thing attr.each do |subattr| subattr << thing # allows for recursive compound attributes end self end |
#push(attrib) ⇒ Object
416 417 418 |
# File 'lib/graph.rb', line 416 def push attrib attr.push attrib end |
#to_s ⇒ Object
427 428 429 |
# File 'lib/graph.rb', line 427 def to_s attr.join ", " end |