Class: Johnson::Visitors::DotVisitor::Link

Inherits:
Struct
  • Object
show all
Defined in:
lib/johnson/visitors/dot_visitor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#attributesObject

Returns the value of attribute attributes

Returns:

  • (Object)

    the current value of attributes



17
18
19
# File 'lib/johnson/visitors/dot_visitor.rb', line 17

def attributes
  @attributes
end

#fromObject

Returns the value of attribute from

Returns:

  • (Object)

    the current value of from



17
18
19
# File 'lib/johnson/visitors/dot_visitor.rb', line 17

def from
  @from
end

#toObject

Returns the value of attribute to

Returns:

  • (Object)

    the current value of to



17
18
19
# File 'lib/johnson/visitors/dot_visitor.rb', line 17

def to
  @to
end

Instance Method Details

#to_sObject



18
19
20
21
22
23
24
25
26
# File 'lib/johnson/visitors/dot_visitor.rb', line 18

def to_s
  attrs = ''
  if attributes
    attrs = " [" + attributes.map { |attribute|
      attribute.join(' = ')
    }.join("; ") + "]"
  end
  "\"#{from}\" -> \"#{to}\"#{attrs};"
end