Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/report_builder.rb

Overview

Add except method to Hash

Instance Method Summary collapse

Instance Method Details

#except(*keys) ⇒ Object



7
8
9
# File 'lib/report_builder.rb', line 7

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

#except!(*keys) ⇒ Object



11
12
13
14
# File 'lib/report_builder.rb', line 11

def except!(*keys)
  keys.each { |key| delete(key) }
  self
end