Class: Cabbage::DotFile

Inherits:
Object
  • Object
show all
Defined in:
lib/cabbage/dotfile/parser.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.



8
9
10
11
12
13
14
15
16
# File 'lib/cabbage/dotfile/parser.rb', line 8

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.



18
19
20
# File 'lib/cabbage/dotfile/parser.rb', line 18

def connections
  @connections
end

#graph_typeObject

Returns the value of attribute graph_type.



18
19
20
# File 'lib/cabbage/dotfile/parser.rb', line 18

def graph_type
  @graph_type
end

#headerObject

Returns the value of attribute header.



18
19
20
# File 'lib/cabbage/dotfile/parser.rb', line 18

def header
  @header
end

#nodesObject

Returns the value of attribute nodes.



18
19
20
# File 'lib/cabbage/dotfile/parser.rb', line 18

def nodes
  @nodes
end

#raw_dotfileObject

Returns the value of attribute raw_dotfile.



18
19
20
# File 'lib/cabbage/dotfile/parser.rb', line 18

def raw_dotfile
  @raw_dotfile
end

#titleObject

Returns the value of attribute title.



18
19
20
# File 'lib/cabbage/dotfile/parser.rb', line 18

def title
  @title
end