Skip to content

Instantly share code, notes, and snippets.

@igor-alexandrov
Created June 12, 2020 09:21
Show Gist options
  • Save igor-alexandrov/feafc7ba043db55accdf7e39d61870d9 to your computer and use it in GitHub Desktop.
Save igor-alexandrov/feafc7ba043db55accdf7e39d61870d9 to your computer and use it in GitHub Desktop.
def process(uri)
if uri.scheme == "http" || uri.scheme == "https"
fetch_using_http(uri) # returns FastImage::Meta
elsif (uri.scheme.nil? || uri.scheme == "file") && !uri.path.nil?
fetch_using_file(uri) # returns FastImage::Meta
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment