Sha256: 08de31521fc5ff49550fe8bed090d3e6c3d99b2eb9b410a886a4bcdcab555983

Contents?: true

Size: 735 Bytes

Versions: 4

Compression:

Stored size: 735 Bytes

Contents

# frozen_string_literal: true

require "influxer/version"
require "active_model"
require "active_support/core_ext"

# Rails client for InfluxDB
module Influxer
  def self.active_model3?
    ActiveModel::VERSION::MAJOR == 3
  end

  require "influxer/config"
  require "influxer/client"
  require "influxer/metrics/metrics"

  module Model # :nodoc:
    require "influxer/model"
  end

  require "influxer/rails/client" if defined?(Rails)
  require "influxer/engine" if defined?(Rails)

  def self.config
    @config ||= Config.new
  end

  def self.configure
    yield(config) if block_given?
  end

  def self.client
    @client ||= Client.new
  end

  def self.reset!
    @client&.stop!
    @config = nil
    @client = nil
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
influxer-1.3.0 lib/influxer.rb
influxer-1.2.2 lib/influxer.rb
influxer-1.2.1 lib/influxer.rb
influxer-1.2.0 lib/influxer.rb