Class: Array
Overview
Array — the collection helpers.
Instance Method Summary collapse
-
#deep_transform_keys(&block) ⇒ Array
a new Array whose Hash elements have the block applied to every key at every depth; non-Hash elements pass through unchanged.
-
#deep_transform_keys!(&block) ⇒ Array
the same transform in place.
-
#to_sentence(words_connector: ", ", two_words_connector: " and ", last_word_connector: ", and ") ⇒ String
the elements through
to_sjoined in reading order:"","a","a and b","a, b, and c"; each connector defaults to English prose and is overridable by keyword.
Instance Method Details
#deep_transform_keys(&block) ⇒ Array
a new Array whose Hash elements have the block applied to every key at every depth; non-Hash elements pass through unchanged. The receiver is untouched.
10 |
# File 'runtime/ext/array.rb', line 10
def deep_transform_keys: () { (untyped key) -> untyped } -> Array[untyped]
|
#deep_transform_keys!(&block) ⇒ Array
the same transform in place. Unlike a typed Hash's keys, an Array's elements don't change type when only the Hash elements' keys reshape, so the bang form mutates the receiver.
23 |
# File 'runtime/ext/array.rb', line 23
def deep_transform_keys!: () { (untyped key) -> untyped } -> Array[untyped]
|
#to_sentence(words_connector: ", ", two_words_connector: " and ", last_word_connector: ", and ") ⇒ String
the elements through to_s joined in reading order: "", "a",
"a and b", "a, b, and c"; each connector defaults to English prose and
is overridable by keyword.
32 |
# File 'runtime/ext/array.rb', line 32
def to_sentence: (?words_connector: String, ?two_words_connector: String, ?last_word_connector: String) -> String
|