Module: Sheriff

Defined in:
lib/sheriff/api.rb,
lib/sheriff/errors.rb,
lib/sheriff/feature_set.rb,
lib/sheriff/jurisdiction.rb

Defined Under Namespace

Modules: ClassMethods Classes: Context, FeatureSet, Jurisdiction

Constant Summary collapse

@@defined_feature_sets =
[]

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.defined_feature_setsObject



6
7
8
# File 'lib/sheriff/api.rb', line 6

def defined_feature_sets
  @@defined_feature_sets
end

.included(base) ⇒ Object



19
20
21
# File 'lib/sheriff/api.rb', line 19

def self.included(base)
  base.extend ClassMethods
end

Instance Method Details

#feature_set(feature_set_name) ⇒ Object



27
28
29
30
31
32
33
# File 'lib/sheriff/api.rb', line 27

def feature_set(feature_set_name)
  context = self

  fs = FeatureSet.find(feature_set_name).dup
  fs.context = context
  fs
end

#FeatureSet(feature_set_name) ⇒ Object



23
24
25
# File 'lib/sheriff/api.rb', line 23

def FeatureSet(feature_set_name)
  FeatureSet.find feature_set_name
end