Class: Subdomainitis::IsSubdomain
- Inherits:
-
Object
- Object
- Subdomainitis::IsSubdomain
- Defined in:
- lib/subdomainitis.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#route_set ⇒ Object
readonly
Returns the value of attribute route_set.
Instance Method Summary collapse
-
#initialize(route_set) ⇒ IsSubdomain
constructor
A new instance of IsSubdomain.
- #matches?(request) ⇒ Boolean
Constructor Details
#initialize(route_set) ⇒ IsSubdomain
Returns a new instance of IsSubdomain.
7 8 9 |
# File 'lib/subdomainitis.rb', line 7 def initialize(route_set) @route_set = route_set end |
Instance Attribute Details
#route_set ⇒ Object (readonly)
Returns the value of attribute route_set.
10 11 12 |
# File 'lib/subdomainitis.rb', line 10 def route_set @route_set end |
Instance Method Details
#matches?(request) ⇒ Boolean
14 15 16 17 18 19 20 |
# File 'lib/subdomainitis.rb', line 14 def matches?(request) if use_fake_subdomains request.GET.has_key?(SUBDOMAIN_KEY) else request.subdomain(tld_length).present? end end |