class TrailGuide::Helper::HelperProxy

Attributes

context[R]

Public Class Methods

new(context, participant: nil) click to toggle source
# File lib/trail_guide/helper/helper_proxy.rb, line 6
def initialize(context, participant: nil)
  @context = context
  @participant = participant
end

Public Instance Methods

choose(key, **opts, &block) click to toggle source
# File lib/trail_guide/helper/helper_proxy.rb, line 20
def choose(key, **opts, &block)
  new(key).choose(**opts, &block)
end
Also aliased as: enroll
choose!(key, **opts, &block) click to toggle source
# File lib/trail_guide/helper/helper_proxy.rb, line 15
def choose!(key, **opts, &block)
  new(key).choose!(**opts, &block)
end
Also aliased as: enroll!
context_type() click to toggle source
# File lib/trail_guide/helper/helper_proxy.rb, line 53
def context_type
  if context.is_a?(ActionView::Context)
    :template
  elsif context.is_a?(ActionController::Base)
    :controller
  end
end
convert(key, checkpoint=nil, **opts, &block) click to toggle source
# File lib/trail_guide/helper/helper_proxy.rb, line 45
def convert(key, checkpoint=nil, **opts, &block)
  new(key).convert(checkpoint, **opts, &block)
end
convert!(key, checkpoint=nil, **opts, &block) click to toggle source
# File lib/trail_guide/helper/helper_proxy.rb, line 41
def convert!(key, checkpoint=nil, **opts, &block)
  new(key).convert!(checkpoint, **opts, &block)
end
enroll(key, **opts, &block)
Alias for: choose
enroll!(key, **opts, &block)
Alias for: choose!
new(key) click to toggle source
# File lib/trail_guide/helper/helper_proxy.rb, line 11
def new(key)
  ExperimentProxy.new(context, key, participant: participant)
end
participant() click to toggle source
# File lib/trail_guide/helper/helper_proxy.rb, line 49
def participant
  @participant ||= context.send(:trailguide_participant)
end
render(key, **opts) click to toggle source
# File lib/trail_guide/helper/helper_proxy.rb, line 37
def render(key, **opts)
  new(key).render(**opts)
end
render!(key, **opts) click to toggle source
# File lib/trail_guide/helper/helper_proxy.rb, line 33
def render!(key, **opts)
  new(key).render!(**opts)
end
run(key, **opts) click to toggle source
# File lib/trail_guide/helper/helper_proxy.rb, line 29
def run(key, **opts)
  new(key).run(**opts)
end
run!(key, **opts) click to toggle source
# File lib/trail_guide/helper/helper_proxy.rb, line 25
def run!(key, **opts)
  new(key).run!(**opts)
end