Class: Influx::Flux::Range
- Inherits:
-
Object
- Object
- Influx::Flux::Range
- Defined in:
- lib/influx/flux/range.rb
Instance Attribute Summary collapse
-
#start ⇒ Object
Returns the value of attribute start.
-
#stop ⇒ Object
Returns the value of attribute stop.
Instance Method Summary collapse
-
#initialize(start: nil, stop: nil) ⇒ Range
constructor
A new instance of Range.
- #to_flux ⇒ Object
Constructor Details
#initialize(start: nil, stop: nil) ⇒ Range
Returns a new instance of Range.
10 11 12 13 |
# File 'lib/influx/flux/range.rb', line 10 def initialize(start: nil, stop: nil) @start = cast_value(start) @stop = cast_value(stop) end |
Instance Attribute Details
#start ⇒ Object
Returns the value of attribute start.
8 9 10 |
# File 'lib/influx/flux/range.rb', line 8 def start @start end |
#stop ⇒ Object
Returns the value of attribute stop.
8 9 10 |
# File 'lib/influx/flux/range.rb', line 8 def stop @stop end |
Instance Method Details
#to_flux ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/influx/flux/range.rb', line 15 def to_flux params = [] params << "start: #{@start}" if @start params << "stop: #{@stop}" if @stop <<~FLUX.chomp |> range(#{params.join(', ')}) FLUX end |