lib/flippeur.rb in flippeur-1.0.0 vs lib/flippeur.rb in flippeur-1.0.1

- old
+ new

@@ -9,24 +9,34 @@ def self.setup(&block) reset module_eval &block end + def self.actor(method_name = nil) + @actor = method_name if method_name + @actor + end + def self.feature(name, &block) features[name] = Feature.new(name, &block) end def self.find(name) features[name] end private + def self.default_actor + :current_person + end + def self.features @features ||= Hash.new { |_,k| raise UnknownFeature, "Unknown feature: #{k}" } end def self.reset @features = nil + @actor = default_actor end - + end