Sha256: 7c2c2326fd2a1e4c3b8aaa8e8e0f1f02014221208777da7344dc8b79f178f67c

Contents?: true

Size: 401 Bytes

Versions: 14

Compression:

Stored size: 401 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
      [8,4,4,4,12].map{|i| Cistern::Mock.random_hex(i)}.join("-")
    end

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

    def api_token
      SecureRandom.hex(20)
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
ey-pro-cli-0.0.17 lib/vendor/core/ey-core/mock/util.rb
ey-pro-cli-0.0.16 lib/vendor/core/ey-core/mock/util.rb
ey-pro-cli-0.0.15 lib/vendor/core/ey-core/mock/util.rb
ey-pro-cli-0.0.14 lib/vendor/core/ey-core/mock/util.rb
ey-pro-cli-0.0.13 lib/vendor/core/ey-core/mock/util.rb
ey-pro-cli-0.0.12 lib/vendor/core/ey-core/mock/util.rb
ey-pro-cli-0.0.11 lib/vendor/core/ey-core/mock/util.rb
ey-pro-cli-0.0.10 lib/vendor/core/ey-core/mock/util.rb
ey-pro-cli-0.0.9 lib/vendor/core/ey-core/mock/util.rb
ey-pro-cli-0.0.8 lib/vendor/core/ey-core/mock/util.rb
ey-pro-cli-0.0.7 lib/vendor/core/ey-core/mock/util.rb
ey-pro-cli-0.0.6 lib/vendor/core/ey-core/mock/util.rb
ey-pro-cli-0.0.5 lib/vendor/core/ey-core/mock/util.rb
ey-pro-cli-0.0.4 lib/vendor/core/ey-core/mock/util.rb