Skip to content

Consolidate functions #4

@garthk

Description

@garthk

This doc output looks a little messy:

honeycomb_start(measurements \\ %{})
Start sending
honeycomb_start(measurements, metadata)

See how my @doc only got used on the first? Workaround might be to emit:

def snake_case_event_name(measurements \\ %{}, metadata \\ %{}) do

… as Elixir is fine with multiple default arguments. You might also find leaving out the do and then repeating the definition leaves you with one function with the same description and multiple implementations. Works for typespecs and pattern matched arguments, anyway. Again, I'd need to experiment before I knew for sure.

Speaking of typespecs, emitting a single do -less declaration at the top even if you have multiple implementations would also make it easier for people to declare typespecs for their t:event_measurements/0 and their t:event-metadata/0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions