Module: FeatureCop::Sampling::ClassMethods
- Defined in:
- lib/feature_cop/sampling.rb
Instance Method Summary collapse
- #sample10(feature, identifier, options = {}) ⇒ Object
- #sample30(feature, identifier, options = {}) ⇒ Object
- #sample50(feature, identifier, options = {}) ⇒ Object
Instance Method Details
#sample10(feature, identifier, options = {}) ⇒ Object
9 10 11 12 13 |
# File 'lib/feature_cop/sampling.rb', line 9 def sample10(feature, identifier, = {}) return true if whitelisted?(feature, identifier, ) return false if blacklisted?(feature, identifier, ) identifier.bytes.sum % 10 == 0 end |
#sample30(feature, identifier, options = {}) ⇒ Object
15 16 17 18 19 |
# File 'lib/feature_cop/sampling.rb', line 15 def sample30(feature, identifier, = {}) return true if whitelisted?(feature, identifier, ) return false if blacklisted?(feature, identifier, ) identifier.bytes.sum % 3 == 0 end |
#sample50(feature, identifier, options = {}) ⇒ Object
21 22 23 24 25 |
# File 'lib/feature_cop/sampling.rb', line 21 def sample50(feature, identifier, = {}) return true if whitelisted?(feature, identifier, ) return false if blacklisted?(feature, identifier, ) identifier.bytes.sum.odd? end |