Module: Darthjee::CoreExt::Hash::Changeable
- Included in:
- Darthjee::CoreExt::Hash
- Defined in:
- lib/darthjee/core_ext/hash/changeable.rb
Overview
Methods responsible for changing hash values
Instance Method Summary collapse
-
#change_values(options = {}) {|value| ... } ⇒ ::Hash
Creates a new hash with changes in its values.
-
#change_values!(options = {}) {|value| ... } ⇒ ::Hash
Changes the values of a hash.
Instance Method Details
#change_values(options = {}) {|value| ... } ⇒ ::Hash
Creates a new hash with changes in its values
47 48 49 |
# File 'lib/darthjee/core_ext/hash/changeable.rb', line 47 def change_values( = {}, &block) deep_dup.change_values!(, &block) end |
#change_values!(options = {}) {|value| ... } ⇒ ::Hash
Changes the values of a hash
82 83 84 |
# File 'lib/darthjee/core_ext/hash/changeable.rb', line 82 def change_values!( = {}, &block) Hash::ValueChanger.new(, &block).change(self) end |