Skip to content

Commit eced84a

Browse files
committed
Delegate Segment.child_spec/1 to adapter
1 parent f11e56e commit eced84a

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

lib/segment.ex

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,17 +164,16 @@ defmodule Segment do
164164
By default if nothing is configured it will start `Segment.Analytics.Batcher`
165165
"""
166166
@spec start_link(String.t()) :: GenServer.on_start()
167-
def start_link(api_key) do
168-
@service.start_link(api_key)
169-
end
167+
defdelegate start_link(api_key), to: @service
170168

171169
@doc """
172170
Start the configured GenServer for handling Segment events with the Segment HTTP Source API Write Key and a custom Tesla Adapter.
173171
174172
By default if nothing is configured it will start `Segment.Analytics.Batcher`
175173
"""
176174
@spec start_link(String.t(), Telsa.adapter()) :: GenServer.on_start()
177-
def start_link(api_key, adapter) do
178-
@service.start_link(api_key, adapter)
179-
end
175+
defdelegate start_link(api_key, adapter), to: @service
176+
177+
@spec child_spec(map()) :: map()
178+
defdelegate child_spec(opts), to: @service
180179
end

0 commit comments

Comments
 (0)