Class: NoAnimations
- Inherits:
-
Object
- Object
- NoAnimations
- Defined in:
- lib/generators/decidim/templates/no_animations.rb
Overview
Disables CSS3 and jQuery animations
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, _options = {}) ⇒ NoAnimations
constructor
A new instance of NoAnimations.
Constructor Details
#initialize(app, _options = {}) ⇒ NoAnimations
Returns a new instance of NoAnimations.
7 8 9 |
# File 'lib/generators/decidim/templates/no_animations.rb', line 7 def initialize(app, = {}) @app = app end |
Instance Method Details
#call(env) ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/generators/decidim/templates/no_animations.rb', line 11 def call(env) @status, @headers, @body = @app.call(env) return [@status, @headers, @body] unless html? response = Rack::Response.new([], @status, @headers) @body.each { |fragment| response.write inject(fragment) } @body.close if @body.respond_to?(:close) response.finish end |