Class: Influx::Flux::Derivative

Inherits:
Object
  • Object
show all
Defined in:
lib/influx/flux/derivative.rb

Instance Method Summary collapse

Constructor Details

#initialize(unit:, non_negative:) ⇒ Derivative

Returns a new instance of Derivative.



8
9
10
11
# File 'lib/influx/flux/derivative.rb', line 8

def initialize(unit:, non_negative:)
  @unit = unit
  @non_negative = non_negative
end

Instance Method Details

#to_fluxObject



13
14
15
16
17
# File 'lib/influx/flux/derivative.rb', line 13

def to_flux
  <<~FLUX.chomp
    |> derivative(unit: #{@unit}, nonNegative: #{@non_negative})
  FLUX
end