Sha256: 1fffc9da5f1b59ba47a16f258fd922a6fba64b84992172de17c59a33abaa8368

Contents?: true

Size: 477 Bytes

Versions: 1

Compression:

Stored size: 477 Bytes

Contents

module InfluxDB
  module Rails
    class Values
      def initialize(values: {}, additional_values: InfluxDB::Rails.current.values)
        @values = values
        @additional_values = additional_values
      end

      def to_h
        expanded_values.reject do |_, value|
          value.blank?
        end
      end

      private

      attr_reader :additional_values, :values

      def expanded_values
        values.merge(additional_values)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
influxdb-rails-1.0.1 lib/influxdb/rails/values.rb