Class: AbExperimentsRails::Settings
- Inherits:
-
Object
- Object
- AbExperimentsRails::Settings
- Defined in:
- lib/ab_experiments_rails/settings.rb
Instance Attribute Summary collapse
-
#experiment_enabled ⇒ Object
Returns the value of attribute experiment_enabled.
-
#experiment_id ⇒ Object
Returns the value of attribute experiment_id.
-
#show_delay ⇒ Object
Returns the value of attribute show_delay.
-
#test_name ⇒ Object
Returns the value of attribute test_name.
Instance Method Summary collapse
- #experiment_enabled? ⇒ Boolean
- #force_param_name ⇒ Object
-
#initialize(options = {}) ⇒ Settings
constructor
A new instance of Settings.
- #original_class ⇒ Object
- #url ⇒ Object
- #variant_class ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Settings
Returns a new instance of Settings.
8 9 10 11 12 13 |
# File 'lib/ab_experiments_rails/settings.rb', line 8 def initialize( = {}) self.show_delay = [:show_delay] self.test_name = [:test_name] self.experiment_id = [:experiment_id] self.experiment_enabled = [:experiment_enabled] end |
Instance Attribute Details
#experiment_enabled ⇒ Object
Returns the value of attribute experiment_enabled.
6 7 8 |
# File 'lib/ab_experiments_rails/settings.rb', line 6 def experiment_enabled @experiment_enabled end |
#experiment_id ⇒ Object
Returns the value of attribute experiment_id.
5 6 7 |
# File 'lib/ab_experiments_rails/settings.rb', line 5 def experiment_id @experiment_id end |
#show_delay ⇒ Object
Returns the value of attribute show_delay.
3 4 5 |
# File 'lib/ab_experiments_rails/settings.rb', line 3 def show_delay @show_delay end |
#test_name ⇒ Object
Returns the value of attribute test_name.
4 5 6 |
# File 'lib/ab_experiments_rails/settings.rb', line 4 def test_name @test_name end |
Instance Method Details
#experiment_enabled? ⇒ Boolean
27 28 29 |
# File 'lib/ab_experiments_rails/settings.rb', line 27 def experiment_enabled? experiment_enabled == true end |
#force_param_name ⇒ Object
31 32 33 |
# File 'lib/ab_experiments_rails/settings.rb', line 31 def force_param_name "#{test_name}_ab" end |
#original_class ⇒ Object
19 20 21 |
# File 'lib/ab_experiments_rails/settings.rb', line 19 def original_class "#{test_name}_original" end |
#url ⇒ Object
15 16 17 |
# File 'lib/ab_experiments_rails/settings.rb', line 15 def url "//www.google-analytics.com/cx/api.js?experiment=#{experiment_id}" end |
#variant_class ⇒ Object
23 24 25 |
# File 'lib/ab_experiments_rails/settings.rb', line 23 def variant_class "#{test_name}_variant" end |