Class: Rukawa::GraphConfig
- Inherits:
-
Struct
- Object
- Struct
- Rukawa::GraphConfig
- Defined in:
- lib/rukawa/configuration.rb
Instance Attribute Summary collapse
-
#concentrate ⇒ Object
Returns the value of attribute concentrate.
-
#node ⇒ Object
Returns the value of attribute node.
-
#nodesep ⇒ Object
Returns the value of attribute nodesep.
-
#rankdir ⇒ Object
Returns the value of attribute rankdir.
-
#ranksep ⇒ Object
Returns the value of attribute ranksep.
-
#rotate ⇒ Object
Returns the value of attribute rotate.
-
#size ⇒ Object
Returns the value of attribute size.
Instance Method Summary collapse
- #attrs ⇒ Object
-
#initialize(*args) ⇒ GraphConfig
constructor
A new instance of GraphConfig.
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
#concentrate ⇒ Object
Returns the value of attribute concentrate
29 30 31 |
# File 'lib/rukawa/configuration.rb', line 29 def concentrate @concentrate end |
#node ⇒ Object
Returns the value of attribute node
29 30 31 |
# File 'lib/rukawa/configuration.rb', line 29 def node @node end |
#nodesep ⇒ Object
Returns the value of attribute nodesep
29 30 31 |
# File 'lib/rukawa/configuration.rb', line 29 def nodesep @nodesep end |
#rankdir ⇒ Object
Returns the value of attribute rankdir
29 30 31 |
# File 'lib/rukawa/configuration.rb', line 29 def rankdir @rankdir end |
#ranksep ⇒ Object
Returns the value of attribute ranksep
29 30 31 |
# File 'lib/rukawa/configuration.rb', line 29 def ranksep @ranksep end |
#rotate ⇒ Object
Returns the value of attribute rotate
29 30 31 |
# File 'lib/rukawa/configuration.rb', line 29 def rotate @rotate end |
#size ⇒ Object
Returns the value of attribute size
29 30 31 |
# File 'lib/rukawa/configuration.rb', line 29 def size @size end |
Instance Method Details
#attrs ⇒ Object
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 |