Module: RTM::Connections
- Defined in:
- rtm/lib/rtm/connection.rb
Instance Method Summary
-
- (Engine) connect(params = {}, *args)
Connects to a topic map engine using the specificed backend and configuration.
-
- (Object) connections(*args)
Return all connections or a particular connection.
Instance Method Details
- (Engine) connect(params = {}, *args)
Connects to a topic map engine using the specificed backend and configuration
25 26 27 28 29 30 31 |
# File 'rtm/lib/rtm/connection.rb', line 25 def connect(params = {}, *args) params ||= {} # this is needed to handle passing nil engine = Engine.load!(params[:backend] || params[:implementation]) connection = engine.connect(params) connections[params[:identifier]] = connection if params[:identifier] connection end |
- (Hash) connections - (Engine) connections(identifier)
Return all connections or a particular connection.
40 41 42 43 44 45 46 47 |
# File 'rtm/lib/rtm/connection.rb', line 40 def connections(*args) @connections ||= {} if args.size > 0 @connections[*args] else @connections end end |