lib/packetgen/header/ospfv2/lsa.rb in packetgen-3.1.3 vs lib/packetgen/header/ospfv2/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 OSPFv2 # This class handles unsupported {OSPFv2 OSPFv2} LSA payloads. # A LSA payload is a {LSAHeader} with a {#body} field. @@ -202,12 +202,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]