Class: Orchestrate::Search::StatsBuilder
- Inherits:
-
Object
- Object
- Orchestrate::Search::StatsBuilder
- Includes:
- AggregateBuilderDelegator, QueryBuilderDelegator
- Defined in:
- lib/orchestrate/search/aggregate_builder.rb
Overview
Stats Builder object for constructing stats functions to be included in the aggregate param
Instance Attribute Summary collapse
- #builder ⇒ AggregateBuilder readonly
-
#field_name ⇒ #to_s
readonly
The field to operate over.
Instance Method Summary collapse
-
#initialize(builder, field_name) ⇒ StatsBuilder
constructor
Initialize a new RangeBuilder object.
-
#to_param ⇒ #to_s
Constructed aggregate string clause.
-
#to_s ⇒ Object
(also: #inspect)
Pretty-Printed string representation of the StatsBuilder object.
Constructor Details
#initialize(builder, field_name) ⇒ StatsBuilder
Initialize a new RangeBuilder object
144 145 146 147 |
# File 'lib/orchestrate/search/aggregate_builder.rb', line 144 def initialize(builder, field_name) @builder = builder @field_name = field_name end |
Instance Attribute Details
#builder ⇒ AggregateBuilder (readonly)
136 137 138 |
# File 'lib/orchestrate/search/aggregate_builder.rb', line 136 def builder @builder end |
#field_name ⇒ #to_s (readonly)
Returns The field to operate over.
139 140 141 |
# File 'lib/orchestrate/search/aggregate_builder.rb', line 139 def field_name @field_name end |
Instance Method Details
#to_param ⇒ #to_s
Returns constructed aggregate string clause.
156 157 158 |
# File 'lib/orchestrate/search/aggregate_builder.rb', line 156 def to_param "#{field_name}:stats" end |
#to_s ⇒ Object Also known as: inspect
Returns Pretty-Printed string representation of the StatsBuilder object.
150 151 152 |
# File 'lib/orchestrate/search/aggregate_builder.rb', line 150 def to_s "#<Orchestrate::Search::StatsBuilder collection=#{collection.name} field_name=#{field_name}>" end |