Class: Rack::DisableCSSAnimations
- Inherits:
-
Object
- Object
- Rack::DisableCSSAnimations
- Defined in:
- lib/rack/disable_css_animations.rb,
lib/rack/disable_css_animations/version.rb
Defined Under Namespace
Classes: Rails
Constant Summary collapse
- VERSION =
"0.4.0"
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ DisableCSSAnimations
constructor
A new instance of DisableCSSAnimations.
Constructor Details
#initialize(app) ⇒ DisableCSSAnimations
Returns a new instance of DisableCSSAnimations.
11 12 13 |
# File 'lib/rack/disable_css_animations.rb', line 11 def initialize app @app = app end |
Instance Method Details
#call(env) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/rack/disable_css_animations.rb', line 15 def call env @status, @headers, @body = @app.call(env) return [@status, @headers, @body] unless html? response = Rack::Response.new([], @status, @headers) @body.each do |fragment| response.write inject(fragment) end @body.close if @body.respond_to?(:close) response.finish end |