Querying

Эти методы возвращают информацию об объекте Enumerable, помимо самих элементов:

  • member? (aliased as include?): Returns true if self == objectfalse otherwise.
  • all?: Returns true if all elements meet a specified criterion; false otherwise.
  • any?: Returns true if any element meets a specified criterion; false otherwise.
  • none?: Returns true if no element meets a specified criterion; false otherwise.
  • one?: Returns true if exactly one element meets a specified criterion; false otherwise.
  • count: Returns the count of elements, based on an argument or block criterion, if given.
  • tally: Returns a new Hash containing the counts of occurrences of each element.