Class: Druid::PostAggregationJavascript

Inherits:
PostAggregation show all
Includes:
PostAggregationOperators
Defined in:
lib/druid/post_aggregation.rb

Instance Attribute Summary

Attributes inherited from PostAggregation

#fieldName, #fieldNames, #fields, #fn, #function, #name, #numBuckets, #type, #value

Instance Method Summary collapse

Methods included from PostAggregationOperators

#*, #+, #-, #/

Methods inherited from PostAggregation

#js, #method_missing

Constructor Details

#initialize(function) ⇒ PostAggregationJavascript

Returns a new instance of PostAggregationJavascript.



190
191
192
193
194
195
# File 'lib/druid/post_aggregation.rb', line 190

def initialize(function)
  super()
  @type = 'javascript'
  @fieldNames = extract_fields(function)
  @function = function
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Druid::PostAggregation

Instance Method Details

#as(field) ⇒ Object



201
202
203
204
# File 'lib/druid/post_aggregation.rb', line 201

def as(field)
  @name = field.fieldName.to_s
  self
end

#field_namesObject



197
198
199
# File 'lib/druid/post_aggregation.rb', line 197

def field_names
  @fieldNames
end