1
2
3
4
def combine_fields_and_data(fields, data)
  fields.collect! { |f| f.to_sym }
  data.map { |row| Hash[*fields.zip(row).flatten] }
...

Ruby On Map fields array and data a...

by charlesroper, September 23, 2008 14:38

One minor point regarding A...

93fc84c261cdce2e2f1d64c8e531ecb7 Talk

Ruby On Map fields array and data a...

by charlesroper, September 22, 2008 17:42

Brilliant! The refactoring ...

93fc84c261cdce2e2f1d64c8e531ecb7 Talk

Ruby On Map fields array and data a...

by charlesroper, September 22, 2008 16:54

OK, good stuff. Elegant sol...

93fc84c261cdce2e2f1d64c8e531ecb7 Talk
1
2
3
4
FIELDS = [ 'first', 'last',      'band' ]
DATA   = [['Kurt',  'Cobain',    'Nirvana'],
          ['Jimi',  'Page',      'Led Zeppelin'],
...

Ruby Map fields array and data a...

by charlesroper, September 22, 2008 15:23, 9 refactorings, tagged with array, hash

First posting here. I just ...

93fc84c261cdce2e2f1d64c8e531ecb7 Talk