Class: Racknga::Middleware::JSONP::Writer
- Inherits:
-
Object
- Object
- Racknga::Middleware::JSONP::Writer
- Defined in:
- lib/racknga/middleware/jsonp.rb
Instance Method Summary (collapse)
- - (Object) each(&block)
-
- (Writer) initialize(callback, body)
constructor
A new instance of Writer.
Constructor Details
- (Writer) initialize(callback, body)
A new instance of Writer
137 138 139 140 |
# File 'lib/racknga/middleware/jsonp.rb', line 137 def initialize(callback, body) @callback = callback @body = body end |
Instance Method Details
- (Object) each(&block)
142 143 144 145 146 |
# File 'lib/racknga/middleware/jsonp.rb', line 142 def each(&block) block.call("#{@callback}(") @body.each(&block) block.call(");") end |