Method: Object#to_array

Defined in:
lib/ruber/utils.rb

#to_arrayArray

Encloses self in an array unless it’s already an array

Unlike @Kernel#Array@, this doesn’t use the @to_ary@ or @to_a@ methods

Returns:

  • (Array)

    self enclosed in an array



124
125
126
# File 'lib/ruber/utils.rb', line 124

def to_array
  [self]
end