Sha256: 77c7117d7aa47506c64735d38b33b7a56f1cd4f34bc3da1b77e1ab4095e3c990

Contents?: true

Size: 571 Bytes

Versions: 6

Compression:

Stored size: 571 Bytes

Contents

module InfluxDB
  module Rails
    class Context
      def reset
        Thread.current[:_influxdb_rails_tags] = {}
        Thread.current[:_influxdb_rails_values] = {}
      end

      def tags
        Thread.current[:_influxdb_rails_tags].to_h
      end

      def tags=(tags)
        Thread.current[:_influxdb_rails_tags] = self.tags.merge(tags)
      end

      def values
        Thread.current[:_influxdb_rails_values].to_h
      end

      def values=(values)
        Thread.current[:_influxdb_rails_values] = self.values.merge(values)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
influxdb-rails-1.0.3 lib/influxdb/rails/context.rb
influxdb-rails-1.0.2 lib/influxdb/rails/context.rb
influxdb-rails-1.0.1 lib/influxdb/rails/context.rb
influxdb-rails-1.0.1.beta3 lib/influxdb/rails/context.rb
influxdb-rails-1.0.1.beta2 lib/influxdb/rails/context.rb
influxdb-rails-1.0.1.beta1 lib/influxdb/rails/context.rb