Skip to content

Commit

Permalink
Use instance variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
postmodern committed Feb 14, 2015
1 parent 3e6552c commit aea6a05
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/public_suffix/domain.rb
Expand Up @@ -90,7 +90,7 @@ def to_s
# # => [nil, "google", "com"]
#
def to_a
[trd, sld, tld]
[@trd, @sld, @tld]
end

# Returns the full domain name.
Expand All @@ -106,7 +106,7 @@ def to_a
# # => "www.google.com"
#
def name
[trd, sld, tld].reject { |part| part.nil? }.join(".")
[@trd, @sld, @tld].reject { |part| part.nil? }.join(".")
end

# Returns a domain-like representation of this object
Expand Down Expand Up @@ -144,7 +144,7 @@ def name
#
def domain
return unless domain?
[sld, tld].join(".")
[@sld, @tld].join(".")
end

# Returns a domain-like representation of this object
Expand Down Expand Up @@ -182,7 +182,7 @@ def domain
#
def subdomain
return unless subdomain?
[trd, sld, tld].join(".")
[@trd, @sld, @tld].join(".")
end

# Returns the rule matching this domain
Expand Down Expand Up @@ -225,7 +225,7 @@ def rule
# @see #subdomain?
#
def domain?
!(tld.nil? || sld.nil?)
!(@tld.nil? || @sld.nil?)
end

# Checks whether <tt>self</tt> looks like a subdomain.
Expand Down Expand Up @@ -257,7 +257,7 @@ def domain?
# @see #domain?
#
def subdomain?
!(tld.nil? || sld.nil? || trd.nil?)
!(@tld.nil? || @sld.nil? || @trd.nil?)
end

# Checks whether <tt>self</tt> is exclusively a domain,
Expand Down

0 comments on commit aea6a05

Please sign in to comment.