Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/github_api/core_ext/array.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#except(*keys) ⇒ Object

Returns a new arrray with keys removed



7
8
9
# File 'lib/github_api/core_ext/array.rb', line 7

def except(*keys)
  self.dup.except!(*keys)
end

#except!(*items) ⇒ Object

Similar to except but modifies self



13
14
15
16
17
# File 'lib/github_api/core_ext/array.rb', line 13

def except!(*items)
  copy = self.dup
  copy.reject! { |item| items.include? item }
  copy
end

#extract_options!Object

Selects a hash from the arguments list



21
22
23
# File 'lib/github_api/core_ext/array.rb', line 21

def extract_options!
  last.is_a?(::Hash) ? pop : {}
end
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy