lib/flipper.rb in flipper-0.10.2 vs lib/flipper.rb in flipper-0.11.0.beta1
- old
+ new
@@ -62,15 +62,12 @@
#
# Examples
#
# Flipper.group(:admins)
#
- # Returns the Flipper::Group if group registered.
- # Raises Flipper::GroupNotRegistered if group is not registered.
+ # Returns Flipper::Group.
def self.group(name)
- groups_registry.get(name)
- rescue Registry::KeyNotFound => e
- raise GroupNotRegistered, "Group #{e.key.inspect} has not been registered"
+ groups_registry.get(name) || Types::Group.new(name)
end
# Internal: Registry of all groups_registry.
def self.groups_registry
@groups_registry ||= Registry.new