Module: RubyQuirks::Hash::EnumByDup

Defined in:
lib/ruby_quirks/hash/enum_by_dup.rb

Instance Method Summary collapse

Instance Method Details

#reject(*args, &block) ⇒ Object



12
13
14
15
# File 'lib/ruby_quirks/hash/enum_by_dup.rb', line 12

def reject(*args, &block)
  return to_enum(:reject) unless block_given?
  dup.tap { |hash| hash.reject!(*args, &block) }
end

#select(*args, &block) ⇒ Object



8
9
10
11
# File 'lib/ruby_quirks/hash/enum_by_dup.rb', line 8

def select(*args, &block)
  return to_enum(:select) unless block_given?
  dup.tap { |hash| hash.select!(*args, &block) }
end