Class: Traver::GraphCreator
- Inherits:
-
Object
- Object
- Traver::GraphCreator
- Defined in:
- lib/traver/graph_creator.rb
Instance Attribute Summary collapse
-
#factories_store ⇒ Object
readonly
Returns the value of attribute factories_store.
-
#factory_name ⇒ Object
readonly
Returns the value of attribute factory_name.
-
#graph ⇒ Object
readonly
Returns the value of attribute graph.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#sequencer ⇒ Object
readonly
Returns the value of attribute sequencer.
Instance Method Summary collapse
- #create_graph ⇒ Object
-
#initialize(factory_name, params, factories_store, sequencer) ⇒ GraphCreator
constructor
A new instance of GraphCreator.
Constructor Details
#initialize(factory_name, params, factories_store, sequencer) ⇒ GraphCreator
Returns a new instance of GraphCreator.
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/traver/graph_creator.rb', line 6 def initialize(factory_name, params, factories_store, sequencer) @factory_name = factory_name @params = params @factories_store = factories_store @sequencer = sequencer @object_creator = ObjectCreator.new(factory_name, params, factories_store, sequencer) @graph = Graph.new end |
Instance Attribute Details
#factories_store ⇒ Object (readonly)
Returns the value of attribute factories_store.
3 4 5 |
# File 'lib/traver/graph_creator.rb', line 3 def factories_store @factories_store end |
#factory_name ⇒ Object (readonly)
Returns the value of attribute factory_name.
3 4 5 |
# File 'lib/traver/graph_creator.rb', line 3 def factory_name @factory_name end |
#graph ⇒ Object (readonly)
Returns the value of attribute graph.
4 5 6 |
# File 'lib/traver/graph_creator.rb', line 4 def graph @graph end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
3 4 5 |
# File 'lib/traver/graph_creator.rb', line 3 def params @params end |
#sequencer ⇒ Object (readonly)
Returns the value of attribute sequencer.
3 4 5 |
# File 'lib/traver/graph_creator.rb', line 3 def sequencer @sequencer end |
Instance Method Details
#create_graph ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/traver/graph_creator.rb', line 17 def create_graph object_creator.after_create = lambda do |creator| graph.add_vertex(creator.factory_name, creator.object) end object_creator.create_object end |