Class: ForemanDiscovery::ImportHookService
- Inherits:
-
Object
- Object
- ForemanDiscovery::ImportHookService
- 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
-
#facts ⇒ Object
readonly
Returns the value of attribute facts.
-
#host ⇒ Object
readonly
Returns the value of attribute host.
Instance Method Summary collapse
- #after_populate ⇒ Object
-
#initialize(host:, facts:) ⇒ ImportHookService
constructor
A new instance of ImportHookService.
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
#facts ⇒ Object (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 |
#host ⇒ Object (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_populate ⇒ Object
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 |