frenzy/lib/frenzy_web/views/feed_view.ex

14 lines
329 B
Elixir
Raw Normal View History

2019-02-11 22:22:35 +00:00
defmodule FrenzyWeb.FeedView do
use FrenzyWeb, :view
2020-06-06 19:23:03 +00:00
alias Frenzy.Feed
@spec feed_site_url(feed :: Feed.t()) :: String.t()
def feed_site_url(%Feed{site_url: site_url}) when is_binary(site_url) do
site_url
end
def feed_site_url(%Feed{feed_url: feed_url}) do
URI.merge(feed_url, "/") |> to_string()
end
2020-06-02 02:24:18 +00:00
end