Module: Aggregations::Helpers::AggregationQueryBuilderHelper

Constant Summary collapse

OBJECT_ARRAY_SETTINGS_FIELDS =
[:order]
OBJECT_ARRAY_QUERY_FIELDS =
[:sort]

Instance Method Summary collapse

Instance Method Details

#name_exprString

Returns : Aggregation name.

Returns:

  • (String)

    : Aggregation name



10
11
12
# File 'lib/aggregations/helpers/aggregation_query_builder_helper.rb', line 10

def name_expr
  @name.to_s
end

#queryHash Also known as: query_expr

Returns : Aggregation query.

Returns:

  • (Hash)

    : Aggregation query



20
21
22
23
24
25
26
# File 'lib/aggregations/helpers/aggregation_query_builder_helper.rb', line 20

def query
  add_value_source_agg_builder if self.class.included_modules.include?(ValuesSourceAggregationHelper)
  add_abstract_agg_builder if self.class.included_modules.include?(AbstractAggregationHelper)
  add_abstract_range_builder if self.class.included_modules.include?(AbstractRangeHelper)
  add_class_attributes if ("#{self.class.name}::ATTRIBUTES".constantize rescue nil).present?
  @query
end

#type_exprString

Returns : Aggregation type.

Returns:

  • (String)

    : Aggregation type



15
16
17
# File 'lib/aggregations/helpers/aggregation_query_builder_helper.rb', line 15

def type_expr
  @type.to_s
end