123456789_123456789_123456789_123456789_123456789_

Class: Rails::Initializable::Collection

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, ::Array
Instance Chain:
self, TSort, ::Array
Inherits: Array
Defined in: railties/lib/rails/initializable.rb

Class Method Summary

::Array - Inherited

.wrap

Wraps its argument in an array unless it is already an array (or array-like).

Instance Method Summary

::Array - Inherited

#append

The human way of thinking about adding stuff to the end of a list is with append.

#blank?

An array is blank if it's empty:

#deep_dup

Returns a deep copy of array.

#extract_options!

Extracts options from a set of arguments.

#fifth

Equal to self[4].

#forty_two

Equal to self[41].

#fourth

Equal to self[3].

#from

Returns the tail of the array from position.

#in_groups

Splits or iterates over the array in number of groups, padding any remaining slots with fill_with unless it is false.

#in_groups_of

Splits or iterates over the array in groups of size number, padding any remaining slots with fill_with unless it is false.

#prepend

The human way of thinking about adding stuff to the beginning of a list is with prepend.

#second

Equal to self[1].

#split

Divides the array into one or more subarrays based on a delimiting value or the result of an optional block.

#third

Equal to self[2].

#to

Returns the beginning of the array up to position.

#to_default_s,
#to_formatted_s

Extends Array#to_s to convert a collection of elements into a comma separated id list if :db argument is given as the format.

#to_param

Calls to_param on all its elements and joins the result with slashes.

#to_query

Converts an array into a string suitable for use as a URL query string, using the given key as the param name.

#to_s
#to_sentence

Converts the array to a comma-separated sentence where the last element is joined by the connector word.

#to_xml

Returns a string that represents the array in XML by invoking to_xml on each element.

Instance Method Details

#+(other)

[ GitHub ]

  
# File 'railties/lib/rails/initializable.rb', line 47

def +(other)
  Collection.new(to_a + other.to_a)
end

#tsort_each_child(initializer, &block)

[ GitHub ]

  
# File 'railties/lib/rails/initializable.rb', line 43

def tsort_each_child(initializer, &block)
  select { |i| i.before == initializer.name || i.name == initializer.after }.each(&block)
end

#tsort_each_node

[ GitHub ]

  
# File 'railties/lib/rails/initializable.rb', line 42

alias :tsort_each_node :each