Class: Array

Inherits:
Object show all
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:
activesupport/lib/active_support/core_ext/array.rb,
activesupport/lib/active_support/core_ext/object/blank.rb,
activesupport/lib/active_support/json/encoders/enumerable.rb,
actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/core_extensions.rb

Overview

:nodoc:

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 'activesupport/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 'activesupport/lib/active_support/json/encoders/enumerable.rb', line 10

def to_json(options = nil) #:nodoc:
  "[#{map { |value| ActiveSupport::JSON.encode(value, options) } * ','}]"
end