Class: Rox::Core::BUID
- Inherits:
-
Object
- Object
- Rox::Core::BUID
- Defined in:
- lib/rox/core/client/buid.rb
Constant Summary collapse
- BUID_GENERATORS =
[ PropertyType::PLATFORM, PropertyType::APP_KEY, PropertyType::LIB_VERSION, PropertyType::API_VERSION ].freeze
Instance Method Summary collapse
-
#initialize(sdk_settings, device_properties, _flag_repository, _custom_property_repository) ⇒ BUID
constructor
A new instance of BUID.
- #query_string_parts ⇒ Object
- #to_s ⇒ Object
- #value ⇒ Object
Constructor Details
#initialize(sdk_settings, device_properties, _flag_repository, _custom_property_repository) ⇒ BUID
Returns a new instance of BUID.
15 16 17 18 19 |
# 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 |
Instance Method Details
#query_string_parts ⇒ Object
33 34 35 36 37 38 39 40 |
# 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 ⇒ Object
42 43 44 |
# File 'lib/rox/core/client/buid.rb', line 42 def to_s @buid end |
#value ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 |
# 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 |