Class: PuppetX::Puppetlabs::Migration::OverviewModel::EdgeIssue Abstract

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

Overview

This class is abstract.

Direct Known Subclasses

EdgeAdded, EdgeMissing

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from NodeIssue

many_rels_hash

Methods inherited from Entity

#<=>, #eql?, from_hash, #hash, #id, init_relationships, many_relationship, #many_relationship, many_rels_hash, simple_name

Methods included from ModelObject

#initialize_from_hash, #to_hash

Constructor Details

#initialize(id, source_id, target_id) ⇒ EdgeIssue

Returns a new instance of EdgeIssue.

Parameters:

  • id (Integer)

    The id of the created instance

  • source_id (Integer)

    The resource id of the source

  • target_id (Integer)

    The resource id of the target



478
479
480
481
482
# File 'lib/puppet_x/puppetlabs/migration/overview_model.rb', line 478

def initialize(id, source_id, target_id)
  super(id)
  @source_id = source_id
  @target_id = target_id
end

Instance Attribute Details

#source_idObject (readonly)



471
472
473
# File 'lib/puppet_x/puppetlabs/migration/overview_model.rb', line 471

def source_id
  @source_id
end

#target_idObject (readonly)



472
473
474
# File 'lib/puppet_x/puppetlabs/migration/overview_model.rb', line 472

def target_id
  @target_id
end

Instance Method Details

#one_relationship(name) ⇒ Object



484
485
486
487
488
489
490
491
# File 'lib/puppet_x/puppetlabs/migration/overview_model.rb', line 484

def one_relationship(name)
  case name
  when :source
    source_id || UNDEFINED_ID
  when :target
    target_id || UNDEFINED_ID
  end
end