Skip to content

Commit 89ea6b0

Browse files
committed
feat(analytics): add definitions for old analytic events API
1 parent e1e6f8e commit 89ea6b0

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# frozen_string_literal: true
2+
3+
module Typesense
4+
class AnalyticsEventsV1
5+
RESOURCE_PATH = '/analytics/events'
6+
7+
def initialize(api_call)
8+
@api_call = api_call
9+
end
10+
11+
def create(params)
12+
@api_call.post(endpoint_path, params)
13+
end
14+
15+
private
16+
17+
def endpoint_path(operation = nil)
18+
"#{AnalyticsEventsV1::RESOURCE_PATH}#{"/#{URI.encode_www_form_component(operation)}" unless operation.nil?}"
19+
end
20+
end
21+
end

0 commit comments

Comments
 (0)