Class: Trebuchet::Strategy::PerDenomination
- Includes:
- PerDenominationable
- Defined in:
- lib/trebuchet/strategy/per_denomination.rb
Instance Attribute Summary
Attributes included from PerDenominationable
Attributes inherited from Base
Instance Method Summary collapse
Methods included from PerDenominationable
#export, #initialize, #to_s, #value_in_range?
Methods inherited from Base
#as_json, #export, #feature_id, #inspect, #name, #needs_user?, strategy_name
Instance Method Details
#launch_at?(user, request = nil) ⇒ Boolean
11 12 13 14 |
# File 'lib/trebuchet/strategy/per_denomination.rb', line 11 def launch_at?(user, request = nil) return false unless user && user.id value_in_range?(user.id.to_i) end |
#set_range_from_options(options = {}) ⇒ Object
4 5 6 7 8 9 |
# File 'lib/trebuchet/strategy/per_denomination.rb', line 4 def ( = {}) numerator = ['numerator'] || [:numerator] || 0 denominator = ['denominator'] || [:denominator] || 0 super(numerator: numerator, denominator: denominator) end |