Class: Flatrack::DomainParser
- Inherits:
-
Struct
- Object
- Struct
- Flatrack::DomainParser
- Defined in:
- lib/flatrack/domain_parser.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
Returns the value of attribute app.
Instance Method Summary collapse
Instance Attribute Details
#app ⇒ Object
Returns the value of attribute app
2 3 4 |
# File 'lib/flatrack/domain_parser.rb', line 2 def app @app end |
Instance Method Details
#call(env) ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/flatrack/domain_parser.rb', line 4 def call(env) *subdomains, host, tld = env['SERVER_NAME'].split '.' env['domain.sub'] = subdomains.join '.' env['domain.host'] = host env['domain.tld'] = tld app.call(env) end |