2015-10-26 12:04:01 +03:00
|
|
|
module Provider
|
2015-10-26 17:14:48 +03:00
|
|
|
class AccountsFactory
|
2015-10-26 12:04:01 +03:00
|
|
|
|
2015-11-19 14:09:38 +03:00
|
|
|
class << self
|
|
|
|
|
|
|
|
|
|
def accounts provider_name
|
|
|
|
|
Devops::Db.connector.provider_accounts(provider_name)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
2015-10-26 16:20:05 +03:00
|
|
|
def init config
|
2015-10-26 12:04:01 +03:00
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
2015-10-26 17:14:48 +03:00
|
|
|
# providers instances
|
2015-10-26 12:04:01 +03:00
|
|
|
def connection account_name
|
2015-10-26 17:14:48 +03:00
|
|
|
@connections[account_name]
|
2015-10-26 12:04:01 +03:00
|
|
|
end
|
2015-10-28 17:27:02 +03:00
|
|
|
|
|
|
|
|
def add_connection name, conn
|
|
|
|
|
@connections[name] = conn
|
|
|
|
|
end
|
|
|
|
|
|
2015-11-02 17:33:25 +03:00
|
|
|
def delete_connection name
|
|
|
|
|
@connections.delete(name)
|
|
|
|
|
end
|
|
|
|
|
|
2015-10-28 17:27:02 +03:00
|
|
|
def create_connection_from_account config, account
|
|
|
|
|
end
|
2015-11-02 17:33:25 +03:00
|
|
|
|
|
|
|
|
def accounts
|
2015-11-19 14:09:38 +03:00
|
|
|
AccountsFactory.accounts(provider_name)
|
2015-11-02 17:33:25 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def create_account hash
|
|
|
|
|
raise "override me"
|
|
|
|
|
end
|
2015-10-26 12:04:01 +03:00
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|