Class: ElmInstall::GraphBuilder
- Inherits:
-
Object
- Object
- ElmInstall::GraphBuilder
- Defined in:
- lib/elm_install/graph_builder.rb
Overview
This class is for building dependency graphs from a cache.
Instance Attribute Summary collapse
-
#graph ⇒ Object
readonly
Returns the value of attribute graph.
Class Method Summary collapse
-
.graph_from_cache(cache, options = { verbose: false }) ⇒ Object
Returns a graph from a cache.
Instance Method Summary collapse
-
#build ⇒ Object
Builds the graph.
-
#initialize(cache, options = { verbose: false }) ⇒ GraphBuilder
constructor
Initialies a graph build with a cache.
Constructor Details
#initialize(cache, options = { verbose: false }) ⇒ GraphBuilder
Initialies a graph build with a cache
14 15 16 17 18 |
# File 'lib/elm_install/graph_builder.rb', line 14 def initialize(cache, = { verbose: false }) @graph = Solve::Graph.new @options = @cache = cache end |
Instance Attribute Details
#graph ⇒ Object (readonly)
Returns the value of attribute graph.
4 5 6 |
# File 'lib/elm_install/graph_builder.rb', line 4 def graph @graph end |
Class Method Details
.graph_from_cache(cache, options = { verbose: false }) ⇒ Object
Returns a graph from a cache.
7 8 9 10 11 |
# File 'lib/elm_install/graph_builder.rb', line 7 def self.graph_from_cache(cache, = { verbose: false }) graph = new cache, graph.build graph.graph end |
Instance Method Details
#build ⇒ Object
Builds the graph.
21 22 23 24 25 |
# File 'lib/elm_install/graph_builder.rb', line 21 def build @cache.each do |package, versions| add_versions package, versions end end |