Sha256: 17f2039e969cdd961ba4ed2389918c305741515503736715b01b408a4f72270f

Contents?: true

Size: 402 Bytes

Versions: 21

Compression:

Stored size: 402 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

21 entries across 21 versions & 4 rubygems

Version Path
activesupport-2.0.0 lib/active_support/json/encoders/enumerable.rb
activesupport-2.0.1 lib/active_support/json/encoders/enumerable.rb
activesupport-2.0.5 lib/active_support/json/encoders/enumerable.rb
activesupport-2.0.4 lib/active_support/json/encoders/enumerable.rb
activesupport-2.0.2 lib/active_support/json/encoders/enumerable.rb
radiant-0.6.5.1 vendor/rails/activesupport/lib/active_support/json/encoders/enumerable.rb
radiant-0.6.5 vendor/rails/activesupport/lib/active_support/json/encoders/enumerable.rb
radiant-0.6.6 vendor/rails/activesupport/lib/active_support/json/encoders/enumerable.rb
radiant-0.6.7 vendor/rails/activesupport/lib/active_support/json/encoders/enumerable.rb
radiant-0.6.8 vendor/rails/activesupport/lib/active_support/json/encoders/enumerable.rb
radiant-0.6.9 vendor/rails/activesupport/lib/active_support/json/encoders/enumerable.rb
spree-0.0.9 vendor/rails/activesupport/lib/active_support/json/encoders/enumerable.rb
spree-0.2.0 vendor/rails/activesupport/lib/active_support/json/encoders/enumerable.rb
swivel-0.0.150 vendor/activesupport-2.0.2-/lib/active_support/json/encoders/enumerable.rb
swivel-0.0.149 vendor/activesupport-2.0.2-/lib/active_support/json/encoders/enumerable.rb
swivel-0.0.156 vendor/activesupport-2.0.2-/lib/active_support/json/encoders/enumerable.rb
swivel-0.0.152 vendor/activesupport-2.0.2-/lib/active_support/json/encoders/enumerable.rb
swivel-0.0.155 vendor/activesupport-2.0.2-/lib/active_support/json/encoders/enumerable.rb
swivel-0.0.175 vendor/activesupport-2.0.2-/lib/active_support/json/encoders/enumerable.rb
swivel-0.0.160 vendor/activesupport-2.0.2-/lib/active_support/json/encoders/enumerable.rb