class Array

Core extensions to Array.

Public Instance Methods

contains?( other ) click to toggle source

Returns true if this array contains other completely.

# File lib/aerogel/core/core_ext/array.rb, line 33
def contains?( other )
  ( other - self ).blank?
end
except( *args ) click to toggle source

Returns array with excluded elements.

# File lib/aerogel/core/core_ext/array.rb, line 9
def except( *args )
  self - [ *args ]
end
except!( *args ) click to toggle source

Modifies and returns array with excluded elements.

# File lib/aerogel/core/core_ext/array.rb, line 15
def except!( *args )
  self.replace( self.except! *args )
end
only( *args ) click to toggle source

Returns array containing only elements listed in args.

# File lib/aerogel/core/core_ext/array.rb, line 21
def only( *args )
  self & [*args]
end
only!( *args ) click to toggle source

Modifies and returns array containing only elements listed in args.

# File lib/aerogel/core/core_ext/array.rb, line 27
def only!( *args )
  self.replace( self.only *args )
end