Class: Rukawa::GraphConfig

Inherits:
Struct
  • Object
show all
Defined in:
lib/rukawa/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ GraphConfig

Returns a new instance of GraphConfig.



30
31
32
33
# File 'lib/rukawa/configuration.rb', line 30

def initialize(*args)
  super
  self.node = GraphNodeConfig.new
end

Instance Attribute Details

#concentrateObject

Returns the value of attribute concentrate

Returns:

  • (Object)

    the current value of concentrate



29
30
31
# File 'lib/rukawa/configuration.rb', line 29

def concentrate
  @concentrate
end

#nodeObject

Returns the value of attribute node

Returns:

  • (Object)

    the current value of node



29
30
31
# File 'lib/rukawa/configuration.rb', line 29

def node
  @node
end

#nodesepObject

Returns the value of attribute nodesep

Returns:

  • (Object)

    the current value of nodesep



29
30
31
# File 'lib/rukawa/configuration.rb', line 29

def nodesep
  @nodesep
end

#rankdirObject

Returns the value of attribute rankdir

Returns:

  • (Object)

    the current value of rankdir



29
30
31
# File 'lib/rukawa/configuration.rb', line 29

def rankdir
  @rankdir
end

#ranksepObject

Returns the value of attribute ranksep

Returns:

  • (Object)

    the current value of ranksep



29
30
31
# File 'lib/rukawa/configuration.rb', line 29

def ranksep
  @ranksep
end

#rotateObject

Returns the value of attribute rotate

Returns:

  • (Object)

    the current value of rotate



29
30
31
# File 'lib/rukawa/configuration.rb', line 29

def rotate
  @rotate
end

#sizeObject

Returns the value of attribute size

Returns:

  • (Object)

    the current value of size



29
30
31
# File 'lib/rukawa/configuration.rb', line 29

def size
  @size
end

Instance Method Details

#attrsObject



35
36
37
38
39
40
41
42
# File 'lib/rukawa/configuration.rb', line 35

def attrs
  if rankdir || size || rotate || ranksep || nodesep || concentrate
    values = to_h.map { |k, v| "#{k} = #{v}" if k != :node && v }.compact
    "graph [#{values.join(",")}];\n"
  else
    ""
  end
end