diff --git a/lib/netbox_client_ruby/api/ipam/ip_address.rb b/lib/netbox_client_ruby/api/ipam/ip_address.rb index 0d73890..6661b19 100644 --- a/lib/netbox_client_ruby/api/ipam/ip_address.rb +++ b/lib/netbox_client_ruby/api/ipam/ip_address.rb @@ -33,12 +33,8 @@ def interface interface_data = data['interface'] return nil unless interface_data - - if interface_data.key?('virtual_machine') - Virtualization::Interface.new interface_data['id'] - else - DCIM::Interface.new interface_data['id'] - end + return Virtualization::Interface.new interface_data['id'] unless interface_data.dig('virtual_machine').nil? + return DCIM::Interface.new interface_data['id'] end end end