Sha256: 013c94ccc81e940180031d23604cca3da16eae3075df5fe9842575bc8c86a14e

Contents?: true

Size: 415 Bytes

Versions: 3

Compression:

Stored size: 415 Bytes

Contents

module CanTango
  class Configuration
    class Accounts < Registry::Clazz
      include Singleton

      def register_account clazz
        register account_name(clazz), clazz
        self
      end
      alias_method :register_class, :register_account

      protected
      
      def account_name clazz
        clazz.name.demodulize.gsub(/(.+)Account$/, '\1').to_s.underscore
      end      
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cantango-config-0.1.9.2 lib/cantango/configuration/accounts.rb
cantango-config-0.1.8.1 lib/cantango/configuration/accounts.rb
cantango-config-0.1.8 lib/cantango/configuration/accounts.rb