Class: Rack::API::Formatter::Jsonp

Inherits:
Base
  • Object
show all
Defined in:
lib/rack/api/formatter/jsonp.rb

Instance Attribute Summary

Attributes inherited from Base

#env, #object, #params

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Rack::API::Formatter::Base

Instance Method Details

#to_formatObject



5
6
7
# File 'lib/rack/api/formatter/jsonp.rb', line 5

def to_format
  params.fetch(:callback, "callback") + "(#{object.to_json});"
end