Class: Druid::PostAggregationJavascript
Instance Method Summary
collapse
#as_json, #to_json, #to_s
#*, #+, #-, #/
Constructor Details
Returns a new instance of PostAggregationJavascript.
126
127
128
129
|
# File 'lib/druid/post_aggregation.rb', line 126
def initialize(function)
@field_names = (function)
@function = function
end
|
Instance Method Details
#as(field) ⇒ Object
135
136
137
138
|
# File 'lib/druid/post_aggregation.rb', line 135
def as(field)
@name = field.name.to_s
self
end
|
#get_field_names ⇒ Object
131
132
133
|
# File 'lib/druid/post_aggregation.rb', line 131
def get_field_names
@field_names
end
|
#to_hash ⇒ Object
140
141
142
143
144
145
146
147
|
# File 'lib/druid/post_aggregation.rb', line 140
def to_hash
{
"type" => "javascript",
"name" => @name,
"fieldNames" => @field_names,
"function" => @function
}
end
|