lib/packetgen/header/tcp/option.rb in packetgen-3.1.3 vs lib/packetgen/header/tcp/option.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 TCP
# Base class to describe a TCP option
# @author Sylvain Daubert
@@ -111,12 +111,10 @@
# Get option as a human readable string
# @return [String]
def to_human
str = self.class == Option ? +"unk-#{kind}" : self.class.to_s.sub(/.*::/, '')
- if (length > 2) && !self[:value].to_s.empty?
- str << ":#{self[:value].to_s.inspect}"
- end
+ str << ":#{self[:value].to_s.inspect}" if (length > 2) && !self[:value].to_s.empty?
str
end
# @return [String]
def inspect