Class: ForemanDiscovery::ImportHookService

Inherits:
Object
  • Object
show all
Defined in:
app/services/foreman_discovery/import_hook_service.rb

Constant Summary collapse

HOOKS =
[
  ForemanDiscovery::ImportHooks::DiscoveryAttribute,
  ForemanDiscovery::ImportHooks::LldpNeighbor,
  ForemanDiscovery::ImportHooks::SubnetAndTaxonomy,
  ForemanDiscovery::ImportHooks::LockTemplates
]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host:, facts:) ⇒ ImportHookService

Returns a new instance of ImportHookService.



12
13
14
15
# File 'app/services/foreman_discovery/import_hook_service.rb', line 12

def initialize(host:, facts:)
  @host = host
  @facts = facts
end

Instance Attribute Details

#factsObject (readonly)

Returns the value of attribute facts.



10
11
12
# File 'app/services/foreman_discovery/import_hook_service.rb', line 10

def facts
  @facts
end

#hostObject (readonly)

Returns the value of attribute host.



10
11
12
# File 'app/services/foreman_discovery/import_hook_service.rb', line 10

def host
  @host
end

Instance Method Details

#after_populateObject



17
18
19
20
21
22
# File 'app/services/foreman_discovery/import_hook_service.rb', line 17

def after_populate
  HOOKS.each do |hook_class|
    hook = hook_class.new(host: host, facts: facts)
    hook.after_populate
  end
end