Sha256: 9cd3ba3666bd18c461b7376df9feac35a4f330103024ddfb55b1ad14ed5b3957

Contents?: true

Size: 373 Bytes

Versions: 34

Compression:

Stored size: 373 Bytes

Contents

require 'multi_json'

module Fanforce::Plugin::Sinatra::JSONHelpers
  def json(*args)
    args[0] = {} if args.size == 0
    content_type (Rack.const_defined?('JSONR') and Rack::JSONR.is_jsonp_request?(request)) ? 'application/javascript' : :json
    MultiJson.dump args[0], :pretty => settings.respond_to?(:json_pretty) && settings.json_pretty
  end
  alias JSON json
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
fanforce-plugin-factory-2.0.0.rc29 lib/fanforce/plugin_factory/sinatra/helpers/json.rb
fanforce-plugin-factory-2.0.0.rc28 lib/fanforce/plugin_factory/sinatra/helpers/json.rb
fanforce-plugin-factory-2.0.0.rc27 lib/fanforce/plugin_factory/sinatra/helpers/json.rb
fanforce-plugin-factory-2.0.0.rc26 lib/fanforce/plugin_factory/sinatra/helpers/json.rb
fanforce-plugin-factory-2.0.0.rc25 lib/fanforce/plugin_factory/sinatra/helpers/json.rb
fanforce-plugin-factory-2.0.0.rc24 lib/fanforce/plugin_factory/sinatra/helpers/json.rb
fanforce-plugin-factory-2.0.0.rc23 lib/fanforce/plugin_factory/sinatra/helpers/json.rb
fanforce-plugin-factory-2.0.0.rc22 lib/fanforce/plugin_factory/sinatra/helpers/json.rb
fanforce-plugin-factory-2.0.0.rc21 lib/fanforce/plugin_factory/sinatra/helpers/json.rb
fanforce-plugin-factory-2.0.0.rc19 lib/fanforce/plugin_factory/sinatra/helpers/json.rb
fanforce-plugin-factory-2.0.0.rc18 lib/fanforce/plugin_factory/sinatra/helpers/json.rb
fanforce-plugin-factory-2.0.0.rc17 lib/fanforce/plugin_factory/sinatra/helpers/json.rb
fanforce-plugin-factory-2.0.0.rc16 lib/fanforce/plugin_factory/sinatra/helpers/json.rb
fanforce-plugin-factory-2.0.0.rc15 lib/fanforce/plugin_factory/sinatra/helpers/json.rb
fanforce-plugin-factory-2.0.0.rc13 lib/fanforce/plugin_factory/sinatra/helpers/json.rb
fanforce-plugin-factory-2.0.0.rc12 lib/fanforce/plugin_factory/sinatra/helpers/json.rb
fanforce-plugin-factory-2.0.0.rc11 lib/fanforce/plugin_factory/sinatra/helpers/json.rb
fanforce-plugin-factory-2.0.0.rc10 lib/fanforce/plugin_factory/sinatra/helpers/json.rb
fanforce-plugin-factory-2.0.0.rc9 lib/fanforce/plugin_factory/sinatra/helpers/json.rb
fanforce-plugin-factory-2.0.0.rc8 lib/fanforce/plugin_factory/sinatra/helpers/json.rb