Skip to content

Commit

Permalink
Move SCHEMES from the global namespace into UrlObject
Browse files Browse the repository at this point in the history
  • Loading branch information
twingly-mob authored and roback committed Sep 8, 2015
1 parent 6a83c2a commit 8b0ab5d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/twingly/url.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

PublicSuffix::List.private_domains = false

SCHEMES = %w(http https)

module Twingly
module URL
module_function

UrlObject = Struct.new(:url, :domain) do
SCHEMES = %w(http https)

def valid?
url && domain && SCHEMES.include?(url.normalized_scheme)
end
Expand Down

0 comments on commit 8b0ab5d

Please sign in to comment.