Class: Cabbage::DotFile
- Inherits:
-
Object
- Object
- Cabbage::DotFile
- Defined in:
- lib/cabbage/dotfile/parser.rb
Instance Attribute Summary collapse
-
#connections ⇒ Object
Returns the value of attribute connections.
-
#graph_type ⇒ Object
Returns the value of attribute graph_type.
-
#header ⇒ Object
Returns the value of attribute header.
-
#nodes ⇒ Object
Returns the value of attribute nodes.
-
#raw_dotfile ⇒ Object
Returns the value of attribute raw_dotfile.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(source = nil) ⇒ DotFile
constructor
pass it a string containing either the DotFile itself, or the path to a DOTfile.
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
#connections ⇒ Object
Returns the value of attribute connections.
18 19 20 |
# File 'lib/cabbage/dotfile/parser.rb', line 18 def connections @connections end |
#graph_type ⇒ Object
Returns the value of attribute graph_type.
18 19 20 |
# File 'lib/cabbage/dotfile/parser.rb', line 18 def graph_type @graph_type end |
#header ⇒ Object
Returns the value of attribute header.
18 19 20 |
# File 'lib/cabbage/dotfile/parser.rb', line 18 def header @header end |
#nodes ⇒ Object
Returns the value of attribute nodes.
18 19 20 |
# File 'lib/cabbage/dotfile/parser.rb', line 18 def nodes @nodes end |
#raw_dotfile ⇒ Object
Returns the value of attribute raw_dotfile.
18 19 20 |
# File 'lib/cabbage/dotfile/parser.rb', line 18 def raw_dotfile @raw_dotfile end |
#title ⇒ Object
Returns the value of attribute title.
18 19 20 |
# File 'lib/cabbage/dotfile/parser.rb', line 18 def title @title end |