Sha256: d8ac41728a710240306f34eec34294c6bad5e15a28e3c5958266c258258f4c85

Contents?: true

Size: 411 Bytes

Versions: 42

Compression:

Stored size: 411 Bytes

Contents

module Enumerable
  # Returns a JSON string representing the enumerable. Any +options+
  # given will be passed on to its elements. For example:
  #
  #   users = User.find(:all)
  #   # => users.to_json(:only => :name)
  #
  # will pass the <tt>:only => :name</tt> option to each user.
  def to_json(options = {}) #:nodoc:
    "[#{map { |value| ActiveSupport::JSON.encode(value, options) } * ', '}]"
  end
end

Version data entries

42 entries across 41 versions & 14 rubygems

Version Path
radiant-0.8.0 vendor/rails/activesupport/lib/active_support/json/encoders/enumerable.rb
radiant-0.7.1 vendor/rails/activesupport/lib/active_support/json/encoders/enumerable.rb