class Rox::Core::BUID

Constants

BUID_GENERATORS

Public Class Methods

new(sdk_settings, device_properties, _flag_repository, _custom_property_repository) click to toggle source
# File lib/rox/core/client/buid.rb, line 15
def initialize(sdk_settings, device_properties, _flag_repository, _custom_property_repository)
  @sdk_settings = sdk_settings
  @device_properties = device_properties
  @buid = nil
end

Public Instance Methods

query_string_parts() click to toggle source
# File lib/rox/core/client/buid.rb, line 33
def query_string_parts
  generators = BUID::BUID_GENERATORS.map { |pt, _| pt.name }

  {
    PropertyType::BUID.name => value,
    PropertyType::BUID_GENERATORS_LIST.name => generators.join(',')
  }
end
to_s() click to toggle source
# File lib/rox/core/client/buid.rb, line 42
def to_s
  @buid
end
value() click to toggle source
# File lib/rox/core/client/buid.rb, line 21
def value
  properties = @device_properties.all_properties
  values = []
  BUID::BUID_GENERATORS.each do |pt, _|
    values << properties[pt.name] if properties.include?(pt.name)
  end

  hash = Digest::MD5.hexdigest(values.join('|'))

  @buid = hash.upcase
end