Class: PuppetX::Puppetlabs::Migration::OverviewModel::Query::NodeExtractor

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet_x/puppetlabs/migration/overview_model/query.rb

Overview

Performs traversal of all relationships of a node and collects all entities that are traversed. The collection is then be used to create a new Overview that represents that node and all its dependencies.

Instance Method Summary collapse

Constructor Details

#initializeNodeExtractor

Returns a new instance of NodeExtractor.



278
279
280
# File 'lib/puppet_x/puppetlabs/migration/overview_model/query.rb', line 278

def initialize
  @entities = {}
end

Instance Method Details

#add_node(node) ⇒ NodeExtractor

Add the given node and all entities reached when performing recursive traversal of all its dependencies

Parameters:

  • node (Wrapper)

    the node to add

Returns:



287
288
289
290
291
292
293
# File 'lib/puppet_x/puppetlabs/migration/overview_model/query.rb', line 287

def add_node(node)
  add(node)
  add(node.baseline_env)
  add(node.preview_env)
  node.issues_on_node.each { |issue_on_node| traverse_IssueOnNode(issue_on_node) }
  self
end

#create_overviewOverview

Creates an overview of the factory’s current entity content

Returns:



298
299
300
# File 'lib/puppet_x/puppetlabs/migration/overview_model/query.rb', line 298

def create_overview
  Overview.new(@entities)
end