Class: ForemanNetbox::NetboxParametersComparator
- Inherits:
-
Object
- Object
- ForemanNetbox::NetboxParametersComparator
- Defined in:
- app/services/foreman_netbox/netbox_parameters_comparator.rb
Instance Attribute Summary collapse
-
#new_hash ⇒ Object
readonly
Returns the value of attribute new_hash.
-
#old_hash ⇒ Object
readonly
Returns the value of attribute old_hash.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(old_hash, new_hash) ⇒ NetboxParametersComparator
constructor
A new instance of NetboxParametersComparator.
Constructor Details
#initialize(old_hash, new_hash) ⇒ NetboxParametersComparator
Returns a new instance of NetboxParametersComparator.
9 10 11 12 |
# File 'app/services/foreman_netbox/netbox_parameters_comparator.rb', line 9 def initialize(old_hash, new_hash) @old_hash = old_hash @new_hash = new_hash end |
Instance Attribute Details
#new_hash ⇒ Object (readonly)
Returns the value of attribute new_hash.
20 21 22 |
# File 'app/services/foreman_netbox/netbox_parameters_comparator.rb', line 20 def new_hash @new_hash end |
#old_hash ⇒ Object (readonly)
Returns the value of attribute old_hash.
20 21 22 |
# File 'app/services/foreman_netbox/netbox_parameters_comparator.rb', line 20 def old_hash @old_hash end |
Class Method Details
.call(old_hash, new_hash) ⇒ Object
5 6 7 |
# File 'app/services/foreman_netbox/netbox_parameters_comparator.rb', line 5 def self.call(old_hash, new_hash) new(old_hash, new_hash).call end |
Instance Method Details
#call ⇒ Object
14 15 16 17 18 |
# File 'app/services/foreman_netbox/netbox_parameters_comparator.rb', line 14 def call keys_diff.deep_merge(diff_old) .deep_merge(diff_new) .compact end |