Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasbair committed Sep 4, 2024
1 parent 90d993e commit 28667ab
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/code_gen/config.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule ExOanda.Config do
use TypedEctoSchema
import Ecto.Changeset

@yaml_file "./config.yml"
@config_file "./config.yml"

@primary_key false

Expand All @@ -29,15 +29,17 @@ defmodule ExOanda.Config do
end
end

@doc false
def changeset(config, params \\ %{}) do
config
|> cast(params, [:module_name, :description])
|> validate_required([:module_name, :description])
|> cast_embed(:functions, with: &functions_changeset/2)
end

@doc false
def load_config do
@yaml_file
@config_file
|> YamlElixir.read_all_from_file!()
|> List.first()
|> Map.fetch!("interfaces")
Expand Down

0 comments on commit 28667ab

Please sign in to comment.