class Misc::Range
A bucket associated with a specific range
Public Class Methods
new(from: nil, to: nil, key: '')
click to toggle source
@param [String|Float] from @param [String|Float] to @param [String] key
# File lib/misc/range.rb, line 11 def initialize(from: nil, to: nil, key: '') @from = from if from.present? @to = to if to.present? @key = key if key.present? end
Public Instance Methods
from_expr()
click to toggle source
@return [String|Float] @!visibility protected
# File lib/misc/range.rb, line 28 def from_expr @from end
key_expr()
click to toggle source
@return [String] @!visibility protected
# File lib/misc/range.rb, line 40 def key_expr @key end
settings()
click to toggle source
return [Hash] serialized json query for object
# File lib/misc/range.rb, line 18 def settings settings = {} settings[:key] = @key if @key.present? settings[:from] = @from if @from.present? settings[:to] = @to if @to.present? settings end
to_expr()
click to toggle source
@return [String|Float] @!visibility protected
# File lib/misc/range.rb, line 34 def to_expr @to end