<Toplevel Module>
<Built-in Module>
Array
—
#8
extends |
| ||||||||
includes | |||||||||
inherits from |
| ||||||||
has properties |
|
Enumerable
—
#1
Object
(
Builtin-Module
)
1 module Enumerable 2 # Coerces the enumerable to an array for JSON encoding. 3 def as_json(options = nil) #:nodoc: 4 to_a 5 end 6 end 7 8 class Array 9 # Returns a JSON string representing the Array. +options+ are passed to each element. 10 def to_json(options = nil) #:nodoc: 11 "[#{map { |value| ActiveSupport::JSON.encode(value, options) } * ','}]" 12 end 13 14 def as_json(options = nil) #:nodoc: 15 self 16 end 17 end