Sha256: e41327b96aedfc5c97a85459dfb1ba2c0f6eb092dcb3cb466c391f7b61796b25

Contents?: true

Size: 774 Bytes

Versions: 2

Compression:

Stored size: 774 Bytes

Contents

--- !ruby/object:RI::MethodDescription 
aliases: 
- !ruby/object:RI::AliasName 
  name: graph
block_params: 
comment: 
- !ruby/struct:SM::Flow::P 
  body: "Like <tt>#map</tt>/<tt>#collect</tt>, but generates a Hash. The block is expected to return two values: the key and the value for the new hash."
- !ruby/struct:SM::Flow::VERB 
  body: "  numbers  = (1..3)\n  squares  = numbers.mash { |n| [n, n*n] }   # { 1=&gt;1, 2=&gt;4, 3=&gt;9 }\n  sq_roots = numbers.mash { |n| [n*n, n] }   # { 1=&gt;1, 4=&gt;2, 9=&gt;3 }\n"
- !ruby/struct:SM::Flow::P 
  body: "CREDIT: Trans CREDIT: Andrew Dudzik (adudzik)"
- !ruby/struct:SM::Flow::P 
  body: "NOTE: Would #correlate would be better?"
full_name: Enumerable#mash
is_singleton: false
name: mash
params: (&yld)
visibility: public

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
facets-2.4.3 doc/ri/Enumerable/mash-i.yaml
facets-2.4.2 doc/ri/Enumerable/mash-i.yaml