Browse files

these methods are always called with a tld_parameter

remove the default parameter since the methods are always called with a
parameter
  • Loading branch information...
1 parent 1ed2c3c commit 3aabac5b0d6ebf3647b6150803219d6acb5c33a6 @tenderlove tenderlove committed Jun 11, 2014
Showing with 3 additions and 3 deletions.
  1. +3 −3 actionpack/lib/action_dispatch/http/url.rb
View
6 actionpack/lib/action_dispatch/http/url.rb
@@ -12,11 +12,11 @@ module URL
self.tld_length = 1
class << self
- def extract_domain(host, tld_length = @@tld_length)
+ def extract_domain(host, tld_length)
host.split('.').last(1 + tld_length).join('.') if named_host?(host)
end
- def extract_subdomains(host, tld_length = @@tld_length)
+ def extract_subdomains(host, tld_length)
if named_host?(host)
parts = host.split('.')
parts[0..-(tld_length + 2)]
@@ -25,7 +25,7 @@ def extract_subdomains(host, tld_length = @@tld_length)
end
end
- def extract_subdomain(host, tld_length = @@tld_length)
+ def extract_subdomain(host, tld_length)
extract_subdomains(host, tld_length).join('.')
end

0 comments on commit 3aabac5

Please sign in to comment.