Initial upload
This commit is contained in:
1 parent
c67653ddee
commit
57bc7b0289
370 files changed
+18479
No files matched your search
@@ -0,0 +1,15 @@
|
||||
defmodule BasketballWebsite do
|
||||
def extract_from_path(data, path) do
|
||||
paths = String.split(path, ".")
|
||||
root = Enum.at(paths, 0)
|
||||
if length(paths) > 1 and data[root] do
|
||||
extract_from_path(data[root], Enum.slice(paths, 1..-1) |> Enum.join("."))
|
||||
else
|
||||
data[root]
|
||||
end
|
||||
end
|
||||
|
||||
def get_in_path(data, path) do
|
||||
Kernel.get_in(data, String.split(path, "."))
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user