Class: Earl::UrlAssembler
- Inherits:
-
Object
- Object
- Earl::UrlAssembler
- Defined in:
- lib/earl/url_assembler.rb
Instance Method Summary collapse
Instance Method Details
#assemble(parts = {}) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/earl/url_assembler.rb', line 4 def assemble( parts={} ) ''.tap do |url| url << ( parts[ :scheme ] + '://' ) if parts[ :scheme ] url << ( parts[ :subdomain ] + '.' ) if parts[ :subdomain ] url << ( parts[ :host ] ) if parts[ :host ] url << ( ':' + parts[ :port ] ) if parts[ :port ] url << ( '/' + parts[ :path ] ) if parts[ :path ] url << ( '?' + parts[ :search ] ) if parts[ :search ] url end end |