module Favicon

Favicon - Favicon Finder for a given URL.

Currently this is a VERY SIMPLE gem that just returns a image for a given URL. Actually, Favicon gem just concatenate two strings and return this value - nothing more, nothing less.

Please, check out our roadmap in the README.md to check what I want to the future of this gem.

Public Class Methods

find(url) click to toggle source
# File lib/favicon.rb, line 16
def self.find(url)

        # Prepare the URL for API Request
        url = prepareUrl(url)

        # Return the values
        return find_favicon(url)
end

Private Class Methods

find_favicon(url) click to toggle source
# File lib/favicon.rb, line 37
def self.find_favicon(url)
        return @base_url_google + url
end
prepareUrl(url) click to toggle source

Preparing url before the API request.

# File lib/favicon.rb, line 28
def self.prepareUrl(url)
        if url[/^https?:\/\//]
      url = url
    else
      url = 'http://' + url
    end
        return url
end