module Ey::Core::Mock::Util
Public Instance Methods
api_token()
click to toggle source
# File lib/ey-core/mock/util.rb, line 19 def api_token SecureRandom.hex(20) end
deep_dup(object)
click to toggle source
# File lib/ey-core/mock/util.rb, line 7 def deep_dup(object) Marshal.load(Marshal.dump(object)) end
ip_address()
click to toggle source
# File lib/ey-core/mock/util.rb, line 15 def ip_address Array.new(4) { rand(256) }.join('.') end
normalize_hash(hash)
click to toggle source
# File lib/ey-core/mock/util.rb, line 3 def normalize_hash(hash) JSON.load(JSON.dump(hash)) end
uuid()
click to toggle source
# File lib/ey-core/mock/util.rb, line 11 def uuid SecureRandom.uuid end