Module: Split::EncapsulatedHelper

Defined in:
lib/split/encapsulated_helper.rb

Defined Under Namespace

Classes: ContextShim

Instance Method Summary collapse

Instance Method Details

#ab_test(*arguments) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/split/encapsulated_helper.rb', line 29

def ab_test(*arguments)
  ret = split_context_shim.ab_test(*arguments)
  # TODO there must be a better way to pass a block straight
  # through to the original ab_test
  if block_given?
    if defined?(capture) # a block in a rails view
      block = Proc.new { yield(ret) }
      concat(capture(ret, &block))
      false
    else
      yield(ret)
    end
  else
    ret
  end
end

#ab_test_finished(*arguments) ⇒ Object



46
47
48
49
# File 'lib/split/encapsulated_helper.rb', line 46

def ab_test_finished(*arguments)
  warn 'DEPRECATION WARNING: ab_test_finished is deprecated and will be removed from Split 2.0.0'
  split_context_shim.finished *arguments
end