Enforce keys for all structs
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
defmodule LastFm.Album do
|
||||
@enforce_keys [:musicbrainz_id, :title]
|
||||
defstruct [:musicbrainz_id, :title]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
defmodule LastFm.Artist do
|
||||
@enforce_keys [:musicbrainz_id, :name]
|
||||
defstruct [:musicbrainz_id, :name, :bio, :image, :play_count]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
|
||||
@@ -8,6 +8,7 @@ defmodule LastFm.Config do
|
||||
user_agent: String.t()
|
||||
}
|
||||
|
||||
@enforce_keys [:api, :api_key, :user]
|
||||
defstruct api: LastFm.Api,
|
||||
api_key: "",
|
||||
user: "",
|
||||
|
||||
@@ -7,6 +7,15 @@ defmodule LastFm.Track do
|
||||
|
||||
alias LastFm.{Album, Artist}
|
||||
|
||||
@enforce_keys [
|
||||
:musicbrainz_id,
|
||||
:title,
|
||||
:artist,
|
||||
:album,
|
||||
:cover_url,
|
||||
:scrobbled_at_uts,
|
||||
:scrobbled_at_label
|
||||
]
|
||||
defstruct [
|
||||
:musicbrainz_id,
|
||||
:title,
|
||||
|
||||
Reference in New Issue
Block a user