Module: Sapling::Memory::AdminAPI

Included in:
Sapling::Memory
Defined in:
lib/sapling/memory.rb

Instance Method Summary collapse

Instance Method Details

#activate_feature(feature) ⇒ Object



5
6
7
# File 'lib/sapling/memory.rb', line 5

def activate_feature(feature)
  features[feature]||=Feature.new
end

#activate_percentage(feature, percentage) ⇒ Object



17
18
19
# File 'lib/sapling/memory.rb', line 17

def activate_percentage(feature, percentage)
  activate_feature(feature).activate_percentage(percentage)
end

#activate_user(feature, user) ⇒ Object



9
10
11
# File 'lib/sapling/memory.rb', line 9

def activate_user(feature, user)
  activate_feature(feature).activate_user(user)
end

#deactivate_percentage(feature) ⇒ Object



21
22
23
# File 'lib/sapling/memory.rb', line 21

def deactivate_percentage(feature)
  activate_feature(feature).deactivate_percentage
end

#deactivate_user(feature, user) ⇒ Object



13
14
15
# File 'lib/sapling/memory.rb', line 13

def deactivate_user(feature, user)
  (f=features[feature]) && f.deactivate_user(user)
end