Class: HookSniff::Statistics

Inherits:
Object
  • Object
show all
Defined in:
lib/hooksniff/api/statistics.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Statistics

Returns a new instance of Statistics.



7
8
9
# File 'lib/hooksniff/api/statistics.rb', line 7

def initialize(client)
  @client = client
end

Instance Method Details

#aggregate_event_types(options = {}) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/hooksniff/api/statistics.rb', line 11

def aggregate_event_types(options = {})
  options = options.transform_keys(&:to_s)
  res = @client.execute_request(
    "GET",
    "/v1/stats/event-types",
    query_params: {
      "since" => options["since"],
      "until" => options["until"]
    }
  )
  AggregateEventTypesOut.deserialize(res)
end