module Provider class AccountsFactory def init config end # providers instances def connection account_name @connections[account_name] end def add_connection name, conn @connections[name] = conn end def create_connection_from_account config, account end end end