Module: Parse::API::Aggregate::ClassMethods

Defined in:
lib/parse/api/aggregate.rb

Overview

Class methods to be applied to Client

Instance Method Summary collapse

Instance Method Details

#aggregate_uri_path(className) ⇒ String

Get the aggregate API path for this class.

className is validated to prevent path-smuggling — aggregate endpoints are master-key-only on Parse Server, so any traversal here pivots a master-key request to a different endpoint.

Parameters:

  • className (String)

    the name of the Parse collection.

Returns:

  • (String)

    the API uri path

Raises:

  • (ArgumentError)

    if className violates the identifier pattern.



35
36
37
38
39
40
41
# File 'lib/parse/api/aggregate.rb', line 35

def aggregate_uri_path(className)
  if className.is_a?(Parse::Pointer)
    className = className.parse_class
  end
  className = Parse::API::PathSegment.identifier!(className, kind: "className")
  "#{PATH_PREFIX}#{className}"
end