First pass at uniformed types, specs and docs
- spec public functions (skipping controllers, views, live views and components) - use types instead of explanations in docs - remove redundant docs - fix typos
This commit is contained in:
@@ -1,6 +1,16 @@
|
||||
defmodule LastFm.Scrobble do
|
||||
defstruct [:track, :artist, :timestamp, :album, :album_artist, :mbid]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
track: String.t(),
|
||||
artist: String.t(),
|
||||
timestamp: integer(),
|
||||
album: String.t() | nil,
|
||||
album_artist: String.t() | nil,
|
||||
mbid: String.t() | nil
|
||||
}
|
||||
|
||||
@spec encode(t()) :: map()
|
||||
def encode(scrobble) do
|
||||
scrobble
|
||||
|> Map.from_struct()
|
||||
|
||||
Reference in New Issue
Block a user