Module: Unobtainium::Support::Identifiers Private

Included in:
Drivers::Phantom, World
Defined in:
lib/unobtainium/support/identifiers.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Contains code for dealing with instance identifiers.

Instance Method Summary collapse

Instance Method Details

#identifier(scope, label, options = nil) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Given a label and a set of options, generate a unique identifier string.



17
18
19
20
21
22
# File 'lib/unobtainium/support/identifiers.rb', line 17

def identifier(scope, label, options = nil)
  digest = { label: label, options: options }
  require 'digest/sha1'
  digest = Digest::SHA1.hexdigest(digest.to_s)
  return "#{scope}-#{digest}"
end