Module: RailsOnboarding::Configuration::AbTesting

Included in:
RailsOnboarding::Configuration
Defined in:
lib/rails_onboarding/configuration/ab_testing.rb

Overview

A/B testing configuration.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ab_testsObject

Returns the value of attribute ab_tests.



5
6
7
# File 'lib/rails_onboarding/configuration/ab_testing.rb', line 5

def ab_tests
  @ab_tests
end

#enable_ab_testingObject

Returns the value of attribute enable_ab_testing.



5
6
7
# File 'lib/rails_onboarding/configuration/ab_testing.rb', line 5

def enable_ab_testing
  @enable_ab_testing
end

Instance Method Details

#ab_test(test_name) ⇒ Hash?

Get a specific A/B test configuration

Parameters:

  • test_name (Symbol, String)

    The name of the test

Returns:

  • (Hash, nil)

    The test configuration or nil



11
12
13
14
# File 'lib/rails_onboarding/configuration/ab_testing.rb', line 11

def ab_test(test_name)
  return nil unless enable_ab_testing
  ab_tests[test_name.to_sym]
end