Class: RDocF95::DOT::Element
- Inherits:
-
SimpleElement
- Object
- SimpleElement
- RDocF95::DOT::Element
- Defined in:
- lib/rdoc-f95/dot.rb
Overview
an element that has options ( node, edge or graph )
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 = []) ⇒ Element
constructor
A new instance of Element.
Methods inherited from SimpleElement
Constructor Details
#initialize(params = {}, option_list = []) ⇒ Element
Returns a new instance of Element.
92 93 94 95 96 97 98 99 100 101 |
# File 'lib/rdoc-f95/dot.rb', line 92 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
90 91 92 |
# File 'lib/rdoc-f95/dot.rb', line 90 def name @name end |
#options ⇒ Object
attr_reader :parent
90 91 92 |
# File 'lib/rdoc-f95/dot.rb', line 90 def @options end |
Instance Method Details
#each_option ⇒ Object
103 104 105 |
# File 'lib/rdoc-f95/dot.rb', line 103 def each_option @options.each{ |i| yield i } end |
#each_option_pair ⇒ Object
107 108 109 |
# File 'lib/rdoc-f95/dot.rb', line 107 def each_option_pair @options.each_pair{ |key, val| yield key, val } end |