ActionSupport in Rails4 Part2
Continue ActionSupport useful record
Extensions to Numeric
Defined in active_support/core_ext/numeric/bytes.rb.
Bytes
All number respond to these methods
1 2 3 4 |
|
Defined in active_support/core_ext/numeric/time.rb.
Time
1 2 3 4 5 6 7 8 |
|
Extensions to Integer
Defined in active_support/core_ext/integer/multiple.rb.
multiple_of
1 2 |
|
Extensions to Enumerable
Defined in active_support/core_ext/enumerable.rb.
sum
1 2 |
|
If a block is given, sum becomes an iterator that yields the elements of the collection and sums the returned values:
1 2 |
|
many?
The method many? is shorthand for collection.size > 1:
1 2 3 |
|
Extensions to Array
Defined in active_support/core_ext/array/access.rb.
1 2 3 4 |
|
Defined in active_support/core_ext/array/prepend_and_append.rb.
prepend and append
1 2 3 4 |
|
Defined in active_support/core_ext/array/grouping.rb
in_groups_of(number, fill_with = nil)
The method in_groups_of splits an array into consecutive groups of a certain size.
1 2 3 |
|
in_groups(number, fill_with = nil)
The method in_groups splits an array into a certain number of groups.
1 2 |
|