Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/split/encapsulated_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ module EncapsulatedHelper

class ContextShim
include Split::Helper
public :ab_test, :finished

def initialize(context)
@context = context
end

def ab_user
@ab_user ||= Split::Persistence.adapter.new(@context)
end
Expand Down
3 changes: 1 addition & 2 deletions lib/split/helper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module Split
module Helper
module_function

def ab_test(metric_descriptor, control = nil, *alternatives)
begin
Expand Down Expand Up @@ -130,8 +131,6 @@ def active_experiments
return experiment_pairs
end

protected

def normalize_metric(metric_descriptor)
if Hash === metric_descriptor
experiment_name = metric_descriptor.keys.first
Expand Down