class ElasticGraph::GraphQL::Aggregation::Key::AggregatedValue

Aggregation key implementation used when we’re dealing with ‘aggregated_values`.

def encode

def encode
  Key.encode([aggregation_name, encoded_field_path, function_name])
end

def field_path

def field_path
  FieldPathEncoder.decode(encoded_field_path)
end

def initialize(aggregation_name:, function_name:, field_path: [], encoded_field_path: FieldPathEncoder.encode(field_path))

the field path is invalid.
instances have valid values for all attributes. `FieldPathEncoder.encode` will raise an exception if
We encode the field path as part of initialization to enforce an invariant that all `AggregatedValue`
def initialize(aggregation_name:, function_name:, field_path: [], encoded_field_path: FieldPathEncoder.encode(field_path))
  Key.verify_no_delimiter_in(aggregation_name, function_name, *field_path)
  super(
    aggregation_name: aggregation_name,
    encoded_field_path: encoded_field_path,
    function_name: function_name
  )
end