Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/active_support/json/encoding/active_support_encoder.rb
Instance Method Summary collapse
-
#as_json(options = nil) ⇒ Object
:nodoc:.
-
#encode_json(encoder) ⇒ Object
:nodoc:.
Instance Method Details
#as_json(options = nil) ⇒ Object
:nodoc:
169 170 171 172 173 |
# File 'lib/active_support/json/encoding/active_support_encoder.rb', line 169 def as_json( = nil) #:nodoc: # use encoder as a proxy to call as_json on all elements, to protect from circular references encoder = && [:encoder] || ActiveSupport::JSON::Encoding::ActiveSupportEncoder.new() map { |v| encoder.as_json(v, ) } end |
#encode_json(encoder) ⇒ Object
:nodoc:
175 176 177 |
# File 'lib/active_support/json/encoding/active_support_encoder.rb', line 175 def encode_json(encoder) #:nodoc: "[#{map { |v| encoder.encode(v, false) } * ','}]" end |