Class: Influx::Flux::Filter
- Inherits:
-
Object
- Object
- Influx::Flux::Filter
- Defined in:
- lib/influx/flux/filter.rb
Instance Method Summary collapse
-
#initialize(**params) ⇒ Filter
constructor
A new instance of Filter.
- #to_flux ⇒ Object
Constructor Details
#initialize(**params) ⇒ Filter
Returns a new instance of Filter.
8 9 10 |
# File 'lib/influx/flux/filter.rb', line 8 def initialize(**params) @params = params end |
Instance Method Details
#to_flux ⇒ Object
12 13 14 15 16 |
# File 'lib/influx/flux/filter.rb', line 12 def to_flux <<~FLUX.chomp |> filter(fn: (r) => #{@params.map { |k, v| "r.#{k} == #{v.to_json}" }.join(' and ')}) FLUX end |