Class: Growthbook::StickyBucketService

Inherits:
Object
  • Object
show all
Defined in:
lib/growthbook/sticky_bucket_service.rb

Overview

Extendable class that can be used as the tracking callback

Direct Known Subclasses

InMemoryStickyBucketService

Instance Method Summary collapse

Instance Method Details

#get_all_assignments(attributes) ⇒ Object



18
19
20
21
22
23
24
25
# File 'lib/growthbook/sticky_bucket_service.rb', line 18

def get_all_assignments(attributes)
  docs = {}
  attributes.each do |attribute_name, attribute_value|
    doc = get_assignments(attribute_name, attribute_value)
    docs[get_key(attribute_name, attribute_value)] = doc if doc
  end
  docs
end

#get_assignments(_attribute_name, _attribute_value) ⇒ Object



6
7
8
# File 'lib/growthbook/sticky_bucket_service.rb', line 6

def get_assignments(_attribute_name, _attribute_value)
  nil
end

#get_key(attribute_name, attribute_value) ⇒ Object



14
15
16
# File 'lib/growthbook/sticky_bucket_service.rb', line 14

def get_key(attribute_name, attribute_value)
  "#{attribute_name}||#{attribute_value}"
end

#save_assignments(_doc) ⇒ Object



10
11
12
# File 'lib/growthbook/sticky_bucket_service.rb', line 10

def save_assignments(_doc)
  nil
end