Module: Vanity
- Defined in:
- lib/vanity.rb,
lib/vanity/helpers.rb,
lib/vanity/version.rb,
lib/vanity/playground.rb,
lib/vanity/metric/base.rb,
lib/vanity/commands/list.rb,
lib/vanity/metric/remote.rb,
lib/vanity/commands/report.rb,
lib/vanity/experiment/base.rb,
lib/vanity/commands/upgrade.rb,
lib/vanity/frameworks/rails.rb,
lib/vanity/experiment/ab_test.rb,
lib/vanity/metric/active_record.rb,
lib/vanity/adapters/mock_adapter.rb,
lib/vanity/adapters/redis_adapter.rb,
lib/vanity/metric/google_analytics.rb,
lib/vanity/adapters/mongodb_adapter.rb,
lib/vanity/adapters/abstract_adapter.rb,
lib/vanity/adapters/active_record_adapter.rb
Overview
All the cool stuff happens in other places.
Defined Under Namespace
Modules: Adapters, Commands, Experiment, Helpers, Rails, Render, Version Classes: Metric, NoExperimentError, Playground
Constant Summary collapse
- VERSION =
"1.8.2"
Class Attribute Summary collapse
-
.playground ⇒ Object
The playground instance.
Class Method Summary collapse
-
.context ⇒ Object
Returns the Vanity context.
-
.context=(context) ⇒ Object
Sets the Vanity context.
-
.template(name) ⇒ Object
Path to template.
Class Attribute Details
.playground ⇒ Object
The playground instance.
366 367 368 |
# File 'lib/vanity/playground.rb', line 366 def playground @playground end |
Class Method Details
.context ⇒ Object
Returns the Vanity context. For example, when using Rails this would be the current controller, which can be used to get/set the vanity identity.
375 376 377 |
# File 'lib/vanity/playground.rb', line 375 def context Thread.current[:vanity_context] end |
.context=(context) ⇒ Object
Sets the Vanity context. For example, when using Rails this would be set by the set_vanity_context before filter (via Vanity::Rails#use_vanity).
381 382 383 |
# File 'lib/vanity/playground.rb', line 381 def context=(context) Thread.current[:vanity_context] = context end |
.template(name) ⇒ Object
Path to template.
386 387 388 389 390 |
# File 'lib/vanity/playground.rb', line 386 def template(name) path = File.join(File.dirname(__FILE__), "templates/#{name}") path << ".erb" unless name["."] path end |