Class: DependencyGraphModel
- Inherits:
-
Object
- Object
- DependencyGraphModel
- Defined in:
- lib/Tokens.rb
Instance Method Summary collapse
-
#initialize(dependencies) ⇒ DependencyGraphModel
constructor
A new instance of DependencyGraphModel.
- #to_dot ⇒ Object
- #to_hash ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(dependencies) ⇒ DependencyGraphModel
Returns a new instance of DependencyGraphModel.
35 36 37 |
# File 'lib/Tokens.rb', line 35 def initialize(dependencies) @dependencies = dependencies end |
Instance Method Details
#to_dot ⇒ Object
47 48 49 50 51 52 53 54 |
# File 'lib/Tokens.rb', line 47 def to_dot res = '' dependencies = denormalize @dependencies dependencies.each{|d| res << d.reverse.join('->') << ' '} 'digraph g{ ' + res + '}' end |
#to_hash ⇒ Object
39 40 41 |
# File 'lib/Tokens.rb', line 39 def to_hash @dependecies end |
#to_s ⇒ Object
43 44 45 |
# File 'lib/Tokens.rb', line 43 def to_s print_dependencies @dependencies,0 end |