Class: Fathom::AggregationsResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/fathom/resources/aggregations.rb

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from Fathom::Resource

Instance Method Details

#list(entity_id:, entity:, aggregates:, **params) ⇒ Object

TODO: Ensure this works properly



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/fathom/resources/aggregations.rb', line 4

def list(entity_id:, entity:, aggregates:, **params)
  filters = params.delete(:filters) || {}
  filters = filters.to_json if filters.is_a?(Hash)

  params.merge!(
    entity_id: entity_id,
    entity: entity,
    aggregates: aggregates,
    filters: filters
  )

  get_request("aggregations", params: params)
end