Ruby: Function Name Ending in Exclaimation or Question Mark

By Xah Lee. Date: .

Method name ending in “!” means it changes the variable's value. For example, myArray.reverse returns a reversed array, myArray.reverse! also changes the variable myArray.

Methods ending in “?” means it returns true or false. (aka “predicate function”.)

Ruby Tutorial

Print

String

Types

Variable

Boolean

Branching

Loop, Iteration

Data Structure

Function

Misc