Remove mutation of argument string
parent
e790ac07c4
commit
f049777a00
|
@ -4,7 +4,7 @@ module Biju
|
||||||
attr_accessor :type_of_address, :number
|
attr_accessor :type_of_address, :number
|
||||||
|
|
||||||
def self.encode(number, type_of_address: :international)
|
def self.encode(number, type_of_address: :international)
|
||||||
number << 'F' if number.length.odd?
|
number = number + 'F' if number.length.odd?
|
||||||
new(
|
new(
|
||||||
number.scan(/../).map(&:reverse).join,
|
number.scan(/../).map(&:reverse).join,
|
||||||
type_of_address: type_of_address
|
type_of_address: type_of_address
|
||||||
|
|
Loading…
Reference in New Issue