Skip to content

Commit

Permalink
docs: more and more docs!
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziinc committed May 8, 2024
1 parent 3f28ef1 commit 34ae1f8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 1 addition & 2 deletions lib/logflare/sources/rules.ex
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ defmodule Logflare.Rules do
alias Logflare.Backends.SourceSup
alias Logflare.Backends


@doc """
Lists rules for a given Source or Backend
"""
Expand All @@ -32,7 +31,7 @@ defmodule Logflare.Rules do
Creates a rule based on a given attr map.
If it is a drain rule with an associated backend, it will attempt to start the backend child on SourceSup if it is running.
"""
@spec create_rule(map()) ::{:ok, Rule.t()} | {:error, Ecto.Changeset.t()}
@spec create_rule(map()) :: {:ok, Rule.t()} | {:error, Ecto.Changeset.t()}
def create_rule(attrs \\ %{}) do
%Rule{}
|> Rule.changeset(attrs)
Expand Down
7 changes: 7 additions & 0 deletions lib/logflare/utils.ex
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ defmodule Logflare.Utils do
)
end

@doc """
Stringifies an atom map to a string map.
### Example
iex> stringify_keys(%{test: "data"})
%{"test" => "data}
"""
@spec stringify_keys(map()) :: map()
def stringify_keys(map = %{}) do
map
Expand Down

0 comments on commit 34ae1f8

Please sign in to comment.