@@ -32,7 +32,9 @@ class Utils
3232 (\d +)W # 8: Weeks
3333 )
3434 $)x . freeze
35- UUID_PREFIX = +'_'
35+
36+ UUID_PREFIX = '_'
37+ @@prefix = '_' . freeze
3638
3739 # Checks if the x509 cert provided is expired.
3840 #
@@ -252,6 +254,8 @@ def self.verify_signature(params)
252254 # @param status_message [Strig] StatusMessage value
253255 # @return [String] The status error message
254256 def self . status_error_msg ( error_msg , raw_status_code = nil , status_message = nil )
257+ error_msg = error_msg . dup
258+
255259 unless raw_status_code . nil?
256260 if raw_status_code . include? "|"
257261 status_codes = raw_status_code . split ( ' | ' )
@@ -262,11 +266,11 @@ def self.status_error_msg(error_msg, raw_status_code = nil, status_message = nil
262266 else
263267 printable_code = raw_status_code . split ( ':' ) . last
264268 end
265- error_msg += ', was ' + printable_code
269+ error_msg << ', was ' + printable_code
266270 end
267271
268272 unless status_message . nil?
269- error_msg += ' -> ' + status_message
273+ error_msg << ' -> ' + status_message
270274 end
271275
272276 error_msg
@@ -400,11 +404,15 @@ def self.retrieve_plaintext(cipher_text, symmetric_key, algorithm)
400404 end
401405
402406 def self . set_prefix ( value )
403- UUID_PREFIX . replace value
407+ @@prefix = value
408+ end
409+
410+ def self . prefix
411+ @@prefix
404412 end
405413
406414 def self . uuid
407- "#{ UUID_PREFIX } " + ( RUBY_VERSION < '1.9' ? "#{ @@uuid_generator . generate } " : "#{ SecureRandom . uuid } " )
415+ "#{ prefix } " + ( RUBY_VERSION < '1.9' ? "#{ @@uuid_generator . generate } " : "#{ SecureRandom . uuid } " )
408416 end
409417
410418 # Given two strings, attempt to match them as URIs using Rails' parse method. If they can be parsed,
0 commit comments