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


25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/split/encapsulated_helper.rb', line 25

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


42
43
44
# File 'lib/split/encapsulated_helper.rb', line 42

def ab_test_finished(*arguments)
  split_context_shim.finished *arguments
end