Class: Array
- Extended by:
- ActiveSupport::CoreExtensions::Array::Wrapper
- Includes:
- ActiveSupport::CoreExtensions::Array::Access, ActiveSupport::CoreExtensions::Array::Conversions, ActiveSupport::CoreExtensions::Array::ExtractOptions, ActiveSupport::CoreExtensions::Array::Grouping, ActiveSupport::CoreExtensions::Array::RandomAccess
- Defined in:
- lib/active_support/core_ext/array.rb,
lib/active_support/core_ext/object/blank.rb,
lib/active_support/json/encoders/enumerable.rb
Overview
:nodoc:
Direct Known Subclasses
Instance Method Summary collapse
-
#as_json(options = nil) ⇒ Object
:nodoc:.
-
#to_json(options = nil) ⇒ Object
Returns a JSON string representing the Array.
Methods included from ActiveSupport::CoreExtensions::Array::Wrapper
Methods included from ActiveSupport::CoreExtensions::Array::RandomAccess
#rand, #random_element, #sample
Methods included from ActiveSupport::CoreExtensions::Array::Grouping
#in_groups, #in_groups_of, #split
Methods included from ActiveSupport::CoreExtensions::Array::ExtractOptions
Methods included from ActiveSupport::CoreExtensions::Array::Conversions
included, #to_formatted_s, #to_param, #to_query, #to_sentence, #to_xml
Methods included from ActiveSupport::CoreExtensions::Array::Access
#fifth, #forty_two, #fourth, #from, #second, #third, #to
Instance Method Details
#as_json(options = nil) ⇒ Object
:nodoc:
14 15 16 |
# File 'lib/active_support/json/encoders/enumerable.rb', line 14 def as_json( = nil) #:nodoc: self end |
#to_json(options = nil) ⇒ Object
Returns a JSON string representing the Array. options
are passed to each element.
10 11 12 |
# File 'lib/active_support/json/encoders/enumerable.rb', line 10 def to_json( = nil) #:nodoc: "[#{map { |value| ActiveSupport::JSON.encode(value, ) } * ','}]" end |