class Druid::PostAggregationOperation

Public Class Methods

new(left, operator, right) click to toggle source
Calls superclass method
# File lib/druid/post_aggregation.rb, line 141
def initialize(left, operator, right)
  super()
  @type = 'arithmetic'
  @fn = operator
  @fields = [
    left.is_a?(Numeric) ? PostAggregationConstant.new(value: left) : left,
    right.is_a?(Numeric) ? PostAggregationConstant.new(value: right) : right,
  ]
end

Public Instance Methods

as(field) click to toggle source
# File lib/druid/post_aggregation.rb, line 151
def as(field)
  @name = field.fieldName.to_s
  self
end
field_names() click to toggle source
# File lib/druid/post_aggregation.rb, line 156
def field_names
  fields.map(&:field_names).flatten.compact.uniq
end