Module: Xqsr3::HashUtilities::DeepTransform
- Included in:
- Hash
- Defined in:
- lib/xqsr3/doc_.rb,
lib/xqsr3/hash_utilities/deep_transform.rb
Overview
Exception-related utilities
Components of interest
-
::Xqsr3::Diagnostics::HashUtilities::deep_transform
-
::Xqsr3::Diagnostics::HashUtilities::deep_transform!
Instance Method Summary collapse
-
#deep_transform(&block) ⇒ Object
Executes the given mandatory 1- or 2-parameter block on the receiving instance, which must be a Hash or a type that responds to the
map
message, returning a copy of the instance in which keys (1-parameter block) or keys and values (2-parameter block) are transformed. -
#deep_transform!(&block) ⇒ Object
Executes the given mandatory 1- or 2-parameter block on the receiving instance, whihc must be a Hash or a type that responds to
[]
,delete
, andkeys
messages, changing the keys (1-parameter block) or keys and values (2-parameter block).
Instance Method Details
#deep_transform(&block) ⇒ Object
Executes the given mandatory 1- or 2-parameter block on the receiving instance, which must be a Hash or a type that responds to the map
message, returning a copy of the instance in which keys (1-parameter block) or keys and values (2-parameter block) are transformed.
133 134 135 136 |
# File 'lib/xqsr3/hash_utilities/deep_transform.rb', line 133 def deep_transform &block DeepTransform.do_deep_transform_on_hashlike_(self, &block) end |
#deep_transform!(&block) ⇒ Object
This method is not strongly exception-safe - failure during transformation can result in a partially transformed instance
Executes the given mandatory 1- or 2-parameter block on the receiving instance, whihc must be a Hash or a type that responds to []
, delete
, and keys
messages, changing the keys (1-parameter block) or keys and values (2-parameter block).
145 146 147 148 |
# File 'lib/xqsr3/hash_utilities/deep_transform.rb', line 145 def deep_transform! &block do_deep_transform_on_self_(&block) end |