Method: InfluxDB2::Client.use
- Defined in:
- lib/influxdb2/client/client.rb
.use(*args) ⇒ Object
Instantiate a new InfluxDB client with code block. The client will be passed as an argument and will be automatically closed when the block terminates.
It takes same args as #initialize.
76 77 78 79 80 81 |
# File 'lib/influxdb2/client/client.rb', line 76 def self.use(*args) client = Client.new(*args) yield client ensure client.close! end |