Class: DOT::DOTElement
- Inherits:
-
DOTSimpleElement
- Object
- DOTSimpleElement
- DOT::DOTElement
- Defined in:
- lib/vendor/puppet/external/dot.rb
Overview
an element that has options ( node, edge, or graph )
Direct Known Subclasses
Instance Attribute Summary collapse
-
#name ⇒ Object
attr_reader :parent.
-
#options ⇒ Object
attr_reader :parent.
Instance Method Summary collapse
- #each_option ⇒ Object
- #each_option_pair ⇒ Object
-
#initialize(params = {}, option_list = []) ⇒ DOTElement
constructor
A new instance of DOTElement.
Methods inherited from DOTSimpleElement
Constructor Details
#initialize(params = {}, option_list = []) ⇒ DOTElement
Returns a new instance of DOTElement.
137 138 139 140 141 142 143 144 145 146 |
# File 'lib/vendor/puppet/external/dot.rb', line 137 def initialize (params = {}, option_list = []) super(params) @name = params['name'] ? params['name'] : nil @parent = params['parent'] ? params['parent'] : nil @options = {} option_list.each{ |i| @options[i] = params[i] if params[i] } @options['label'] ||= @name if @name != 'node' end |
Instance Attribute Details
#name ⇒ Object
attr_reader :parent
135 136 137 |
# File 'lib/vendor/puppet/external/dot.rb', line 135 def name @name end |
#options ⇒ Object
attr_reader :parent
135 136 137 |
# File 'lib/vendor/puppet/external/dot.rb', line 135 def @options end |
Instance Method Details
#each_option ⇒ Object
148 149 150 |
# File 'lib/vendor/puppet/external/dot.rb', line 148 def each_option @options.each{ |i| yield i } end |
#each_option_pair ⇒ Object
152 153 154 |
# File 'lib/vendor/puppet/external/dot.rb', line 152 def each_option_pair @options.each_pair{ |key, val| yield key, val } end |