Class: FontAssets::Middleware

Inherits:
Object
  • Object
show all
Defined in:
lib/font_assets/middleware.rb

Defined Under Namespace

Classes: FontAssetsRequest

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app, origin, options = {}) ⇒ Middleware

Returns a new instance of Middleware.


8
9
10
11
12
13
# File 'lib/font_assets/middleware.rb', line 8

def initialize(app, origin, options={})
  @app = app
  @origin = origin
  @options = options
  @mime_types = FontAssets::MimeTypes.new(Rack::Mime::MIME_TYPES)
end

Instance Attribute Details

#mime_typesObject (readonly)

Returns the value of attribute mime_types


6
7
8
# File 'lib/font_assets/middleware.rb', line 6

def mime_types
  @mime_types
end

#optionsObject (readonly)

Returns the value of attribute options


6
7
8
# File 'lib/font_assets/middleware.rb', line 6

def options
  @options
end

#originObject (readonly)

Returns the value of attribute origin


6
7
8
# File 'lib/font_assets/middleware.rb', line 6

def origin
  @origin
end

Instance Method Details

#call(env) ⇒ Object


15
16
17
18
19
# File 'lib/font_assets/middleware.rb', line 15

def call(env)
  FontAssetsRequest.new(self, env).do_request do
    @app.call(env)
  end
end