Module: PartyResource::Connector
- Defined in:
- lib/party_resource/connector.rb,
lib/party_resource/connector/base.rb
Defined Under Namespace
Classes: Base, Repository
Class Method Summary collapse
-
.add(name, options) ⇒ Object
Add a new named connector.
-
.lookup(name) ⇒ Connector::Base
Find connector by name.
- .repository ⇒ Object
Class Method Details
.add(name, options) ⇒ Object
Add a new named connector
26 27 28 |
# File 'lib/party_resource/connector.rb', line 26 def add(name, ) repository.new_connector(name, ) end |
.lookup(name) ⇒ Connector::Base
Find connector by name
7 8 9 10 11 12 |
# File 'lib/party_resource/connector.rb', line 7 def lookup(name) name ||= repository.default connector = repository.connectors[name] raise Exceptions::NoConnector.new(name) if connector.nil? connector end |
.repository ⇒ Object
30 31 32 |
# File 'lib/party_resource/connector.rb', line 30 def repository @repository ||= Repository.new end |