From f049777a000bbbc8f19efe4564da382c06d66732 Mon Sep 17 00:00:00 2001 From: Guillaume DOTT Date: Tue, 10 Sep 2013 14:59:40 +0200 Subject: [PATCH] Remove mutation of argument string --- lib/biju/pdu/phone_number.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/biju/pdu/phone_number.rb b/lib/biju/pdu/phone_number.rb index 8ecdda8..a52a67c 100644 --- a/lib/biju/pdu/phone_number.rb +++ b/lib/biju/pdu/phone_number.rb @@ -4,7 +4,7 @@ module Biju attr_accessor :type_of_address, :number def self.encode(number, type_of_address: :international) - number << 'F' if number.length.odd? + number = number + 'F' if number.length.odd? new( number.scan(/../).map(&:reverse).join, type_of_address: type_of_address