Sha256: 12ca63ef73a6a0f75762aa2dc0cff8af2c4aed2eaaa0da9c39bcd90a6cec9ed4

Contents?: true

Size: 407 Bytes

Versions: 2

Compression:

Stored size: 407 Bytes

Contents

module CanTango
  class Config
    class Users < CanTango::Registry::Clazz
      include Singleton
      
      def register_user clazz
        register user_name(clazz), clazz
      end
      alias_method :register_class, :register_user
              
      protected
      
      def user_name clazz
        clazz.name.demodulize.gsub(/(.+)User$/, '\1').to_s.underscore
      end      
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cantango-config-0.2.1 lib/cantango/config/users.rb
cantango-config-0.2.0 lib/cantango/config/users.rb