Class: Influx::Flux::Fill

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

Instance Method Summary collapse

Constructor Details

#initialize(use_previous: false, value: nil) ⇒ Fill

Returns a new instance of Fill.



9
10
11
12
# File 'lib/influx/flux/fill.rb', line 9

def initialize(use_previous: false, value: nil)
  @use_previous = use_previous
  @value = value
end

Instance Method Details

#to_fluxObject



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/influx/flux/fill.rb', line 14

def to_flux
  if @use_previous
    "      |> fill(usePrevious: \#{@use_previous})\n    FLUX\n  else\n    <<~FLUX.chomp\n      |> fill(value: \#{@value})\n    FLUX\n  end\nend\n".chomp