class Astro::Middleware::QueryString

Public Class Methods

new( app ) click to toggle source
# File lib/astro/middleware/query_string.rb, line 5
def initialize( app )
  @app = app
end

Public Instance Methods

call( env ) click to toggle source

Parses the asset list query string format into an array of assets and assigns it to ‘env`. Currently, asset names are simply separated by commas.

# File lib/astro/middleware/query_string.rb, line 13
def call( env )
  req = Rack::Request.new( env )
  str = Rack::Utils.unescape( req.query_string )

  env[ 'astro.assets' ] = str.split ':'

  @app.call env
end