Module: FeatureFlagger::Model::ClassMethods

Defined in:
lib/feature_flagger/model.rb

Instance Method Summary collapse

Instance Method Details

#all_released_ids_for(feature_key) ⇒ Object


34
35
36
37
# File 'lib/feature_flagger/model.rb', line 34

def all_released_ids_for(feature_key)
  Feature.new(feature_key, rollout_resource_name).fetch!
  Control.resource_ids(feature_key, rollout_resource_name)
end

#rollout_resource_nameObject


39
40
41
42
43
44
45
46
47
# File 'lib/feature_flagger/model.rb', line 39

def rollout_resource_name
  klass_name = self.to_s
  klass_name.gsub!(/::/, '_')
  klass_name.gsub!(/([A-Z\d]+)([A-Z][a-z])/,'\1_\2')
  klass_name.gsub!(/([a-z\d])([A-Z])/,'\1_\2')
  klass_name.tr!("-", "_")
  klass_name.downcase!
  klass_name
end