Class: Trebuchet::Strategy::VisitorPercentDeprecated
- Includes:
- PercentableDeprecated
- Defined in:
- lib/trebuchet/strategy/visitor_percent_deprecated.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(options) ⇒ VisitorPercentDeprecated
constructor
A new instance of VisitorPercentDeprecated.
- #launch_at?(user, request = nil) ⇒ Boolean
- #needs_user? ⇒ Boolean
Methods included from PercentableDeprecated
#export, #offset, #offset_from, #offset_to, #percentage, #set_range_from_options, #to_s, #value_in_range?
Methods inherited from Base
#as_json, #export, #feature_id, #inspect, #name, strategy_name
Constructor Details
#initialize(options) ⇒ VisitorPercentDeprecated
Returns a new instance of VisitorPercentDeprecated.
5 6 7 |
# File 'lib/trebuchet/strategy/visitor_percent_deprecated.rb', line 5 def initialize() () end |
Instance Method Details
#launch_at?(user, request = nil) ⇒ Boolean
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/trebuchet/strategy/visitor_percent_deprecated.rb', line 9 def launch_at?(user, request = nil) return false if request.nil? if Trebuchet.visitor_id.respond_to?(:call) visitor_id = Trebuchet.visitor_id.call(request) else visitor_id = nil end return false if visitor_id.nil? value_in_range?(visitor_id.to_i) end |
#needs_user? ⇒ Boolean
20 21 22 |
# File 'lib/trebuchet/strategy/visitor_percent_deprecated.rb', line 20 def needs_user? false end |