lib/packetgen/header/ospfv3/lsa.rb in packetgen-3.1.3 vs lib/packetgen/header/ospfv3/lsa.rb in packetgen-3.1.4

- old
+ new

@@ -1,12 +1,12 @@ +# frozen_string_literal: true + # This file is part of PacketGen # See https://github.com/sdaubert/packetgen for more informations # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net> # This program is published under MIT license. -# frozen_string_literal: true - module PacketGen module Header class OSPFv3 # This class handles links in a {LSARouter OSPFv3 LSA router payload}. # @author Sylvain Daubert @@ -195,12 +195,10 @@ end private def record_from_hash(hsh) - unless hsh.key? :type - raise ArgumentError, 'hash should have :type key' - end + raise ArgumentError, 'hash should have :type key' unless hsh.key? :type klass = if @only_headers LSAHeader else case hsh[:type]