Class: RDocF95::DOT::Edge

Inherits:
Element show all
Defined in:
lib/rdoc-f95/dot.rb

Overview

this is edge

Instance Attribute Summary collapse

Attributes inherited from Element

#name, #options

Attributes inherited from SimpleElement

#name

Instance Method Summary collapse

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

#fromObject

Returns the value of attribute from


231
232
233
# File 'lib/rdoc-f95/dot.rb', line 231

def from
  @from
end

#toObject

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