Sha256: 54a657034fb7b4adda564a5b7d2d912c6d1910b9bd28d830cfa7d5858b5e8649

Contents?: true

Size: 362 Bytes

Versions: 39

Compression:

Stored size: 362 Bytes

Contents

module Ey::Core::Mock
  module Util
    def normalize_hash(hash)
      JSON.load(JSON.dump(hash))
    end

    def deep_dup(object)
      Marshal.load(Marshal.dump(object))
    end

    def uuid
      SecureRandom.uuid
    end

    def ip_address
      Array.new(4) { rand(256) }.join('.')
    end

    def api_token
      SecureRandom.hex(20)
    end
  end
end

Version data entries

39 entries across 39 versions & 2 rubygems

Version Path
ey-core-3.6.0.autoscaling1 lib/ey-core/mock/util.rb
ey-core-3.6.4 lib/ey-core/mock/util.rb
ey-core-3.6.3 lib/ey-core/mock/util.rb
ey-core-3.6.1 lib/ey-core/mock/util.rb
groove-ey-core-3.6.3 lib/ey-core/mock/util.rb
groove-ey-core-3.6.2 lib/ey-core/mock/util.rb
groove-ey-core-3.6.1 lib/ey-core/mock/util.rb
ey-core-3.5.0 lib/ey-core/mock/util.rb
ey-core-3.4.4 lib/ey-core/mock/util.rb
ey-core-3.4.2 lib/ey-core/mock/util.rb
ey-core-3.4.1 lib/ey-core/mock/util.rb
ey-core-3.4.0 lib/ey-core/mock/util.rb
ey-core-3.3.1 lib/ey-core/mock/util.rb
ey-core-3.3.0 lib/ey-core/mock/util.rb
ey-core-3.2.6 lib/ey-core/mock/util.rb
ey-core-3.2.5 lib/ey-core/mock/util.rb
ey-core-3.2.4 lib/ey-core/mock/util.rb
ey-core-3.2.3 lib/ey-core/mock/util.rb
ey-core-3.2.2 lib/ey-core/mock/util.rb
ey-core-3.2.1 lib/ey-core/mock/util.rb