Class: Array

Overview

:nodoc:

Direct Known Subclasses

ActiveSupport::Callbacks::CallbackChain

Instance Method Summary collapse

Methods included from ActiveSupport::CoreExtensions::Array::Wrapper

wrap

Methods included from ActiveSupport::CoreExtensions::Array::RandomAccess

#rand, #random_element

Methods included from ActiveSupport::CoreExtensions::Array::Grouping

#in_groups, #in_groups_of, #split

Methods included from ActiveSupport::CoreExtensions::Array::ExtractOptions

#extract_options!

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(options = 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(options = nil) #:nodoc:
  "[#{map { |value| ActiveSupport::JSON.encode(value, options) } * ','}]"
end