Class: PuppetX::Puppetlabs::Migration::OverviewModel::Compilation

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Entity

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

Methods included from ModelObject

#initialize_from_hash, #to_hash

Constructor Details

#initialize(id, node_id, environment_id, baseline) ⇒ Compilation

Returns a new instance of Compilation.



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

def initialize(id, node_id, environment_id, baseline)
  super(id)
  @node_id = node_id
  @environment_id = environment_id
  @baseline = baseline
end

Instance Attribute Details

#baselineObject (readonly)

Returns the value of attribute baseline.



296
297
298
# File 'lib/puppet_x/puppetlabs/migration/overview_model.rb', line 296

def baseline
  @baseline
end

#environment_idObject (readonly)

Returns the value of attribute environment_id.



295
296
297
# File 'lib/puppet_x/puppetlabs/migration/overview_model.rb', line 295

def environment_id
  @environment_id
end

#node_idObject (readonly)

Returns the value of attribute node_id.



294
295
296
# File 'lib/puppet_x/puppetlabs/migration/overview_model.rb', line 294

def node_id
  @node_id
end

Class Method Details

.many_rels_hashObject



318
319
320
321
322
# File 'lib/puppet_x/puppetlabs/migration/overview_model.rb', line 318

def self.many_rels_hash
  {
    :log_entries => LogEntry.instance_method(:compilation_id)
  }
end

Instance Method Details

#baseline?Boolean

Returns:

  • (Boolean)


314
315
316
# File 'lib/puppet_x/puppetlabs/migration/overview_model.rb', line 314

def baseline?
  @baseline
end

#one_relationship(name) ⇒ Object



305
306
307
308
309
310
311
312
# File 'lib/puppet_x/puppetlabs/migration/overview_model.rb', line 305

def one_relationship(name)
  case name
  when :node
    node_id || UNDEFINED_ID
  when :environment
    environment_id || UNDEFINED_ID
  end
end