Class: Cabbage::DotFile

Inherits:
Object
  • Object
show all
Defined in:
lib/cabbage.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source = nil) ⇒ DotFile

pass it a string containing either the DotFile itself, or the path to a DOTfile.



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

def initialize(source = nil)
  @raw_dotfile = ""  # unparsed DOTfile
  @graph_type = ""         # 
  @title = ""
  @header = {}
  @nodes = []
  @connections = []
  source != nil if parse(source)
end

Instance Attribute Details

#connectionsObject

Returns the value of attribute connections.



28
29
30
# File 'lib/cabbage.rb', line 28

def connections
  @connections
end

#graph_typeObject

Returns the value of attribute graph_type.



28
29
30
# File 'lib/cabbage.rb', line 28

def graph_type
  @graph_type
end

#headerObject

Returns the value of attribute header.



28
29
30
# File 'lib/cabbage.rb', line 28

def header
  @header
end

#nodesObject

Returns the value of attribute nodes.



28
29
30
# File 'lib/cabbage.rb', line 28

def nodes
  @nodes
end

#raw_dotfileObject

Returns the value of attribute raw_dotfile.



28
29
30
# File 'lib/cabbage.rb', line 28

def raw_dotfile
  @raw_dotfile
end

#titleObject

Returns the value of attribute title.



28
29
30
# File 'lib/cabbage.rb', line 28

def title
  @title
end