Class: RDocF95::DOT::Edge
- Inherits:
-
Element
- Object
- SimpleElement
- Element
- RDocF95::DOT::Edge
- Defined in:
- lib/rdoc-f95/dot.rb
Overview
this is edge
Instance Attribute Summary collapse
-
#from ⇒ Object
Returns the value of attribute from.
-
#to ⇒ Object
Returns the value of attribute to.
Attributes inherited from Element
Attributes inherited from SimpleElement
Instance Method Summary collapse
-
#initialize(params = {}, option_list = EDGE_OPTS) ⇒ Edge
constructor
A new instance of Edge.
- #to_s(t = '') ⇒ Object
Methods inherited from Element
#each_option, #each_option_pair
Constructor Details
#initialize(params = {}, option_list = EDGE_OPTS) ⇒ Edge
Returns a new instance of Edge.
232 233 234 235 236 |
# File 'lib/rdoc-f95/dot.rb', line 232 def initialize( params = {}, option_list = EDGE_OPTS ) super( params, option_list ) @from = params['from'] ? params['from'] : nil @to = params['to'] ? params['to'] : nil end |
Instance Attribute Details
#from ⇒ Object
Returns the value of attribute from.
231 232 233 |
# File 'lib/rdoc-f95/dot.rb', line 231 def from @from end |
#to ⇒ Object
Returns the value of attribute to.
231 232 233 |
# File 'lib/rdoc-f95/dot.rb', line 231 def to @to end |
Instance Method Details
#to_s(t = '') ⇒ Object
238 239 240 241 242 243 244 245 |
# File 'lib/rdoc-f95/dot.rb', line 238 def to_s( t = '' ) t + "#{@from} -> #{to} [\n" + @options.to_a.collect{ |i| i[1] && i[0] != 'label' ? t + TAB + "#{i[0]} = #{i[1]}" : i[1] ? t + TAB + "#{i[0]} = \"#{i[1]}\"" : nil }.compact.join( "\n" ) + "\n" + t + "]\n" end |