1
2
3
4
class Array
  def to_h
    hash = {}
...

Ruby Conversion from the 2d arra...

by Dmitry Polushkin, October 22, 2008 09:11, 7 refactorings, tagged with 2d array, hash, convert

Conversion from the 2d arra...

832ed6ace46d61032151f4e1864c057f Talk
1
2
3
4
  def translation_links
    lang = [
      %w[en english us], 
...

Ruby nested array to set of html...

by seaofclouds, October 09, 2008 07:51, 2 refactorings, tagged with ruby, array, hash, translation

i have a simple array that ...

F55e8e113669f6ea7d1d99f38907ce54 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
1
2
3
4
pools = {1 => [1,2,3], 2=> [3,4,5], 3=> [5,6,7]}
intersection = []
pools.each do |k,v|
...

Ruby Find the Intersection of Ar...

by AviFlombaum, July 31, 2008 21:28, 13 refactorings, tagged with arrays, hash, intersection

Find the intersection of ar...

Fafb062f6e8c394dd6b0689c13db2b88 Talk
1
2
3
4
    times.each do |time|
      events.each do |event|
        if time.strftime("%I:%M %p") == event.datetime.strftime("%I:%M %p")
...

Ruby two for loops cleanup?

by ttdavett.myopenid.com, July 31, 2008 00:11, 7 refactorings, tagged with rails, ruby, array, hash

times is an array of dateti...

F677fa685a2cfe8aff31f161062db3d3 Talk
1
2
3
4
module Keys_to_Meths
  def method_missing(meth, *args)
    if meth.to_s[-1] == 61 #if last char is an equal sign
...

Ruby Hash.keys_to_attr

by Ryguy, June 12, 2008 04:05, 3 refactorings, tagged with hash, methods

/no comment/

>_>

Ba665f86f90a1982af7b9c857418fcdb Talk
1
2
3
4
require 'net/http'
require 'rubygems'
require 'xmlsimple'
...

Ruby Parsing XML from a Web Service

by mwilliams, May 17, 2008 21:10, 3 refactorings, tagged with ruby, hash, xml, web, service

I'm working with a web serv...

4236ea6b84f4899b469e8edff4bf6d22 Talk
1
2
3
4
require 'erb'

# GOAL: render the template with the following vars
...

Ruby Given a hash of variables, ...

by mislav, April 12, 2008 15:12, 3 refactorings, tagged with erb, singleton, metaclass, metaprogramming, hash, render

This works. Now, is there a...

8f93a872e399bc1353cc8d4e791d5401 Talk
1
2
3
4
class Hash
  def fetch_all(key)
    results = []
...

Ruby Recursive Hash#fetch

by Neo, March 12, 2008 14:05, 1 refactoring, tagged with nested hash, hash, fetch

I wanted a Hash#fetch that ...

E64b3f6a4b0bde29f654eca45fcbb20f Talk
1
2
3
4
<table class="charge">
  <tr>
    <td colspan="100%" class="mainHeader"><%=@label.label%></td>
...

Ruby Iterating through a nested ...

by mwilliams, January 31, 2008 18:21, 2 refactorings, tagged with rails, view, table, hash, nested hash, iterator, iterate, ruby, Ruby on Rails

Good afternoon. I have a n...

4236ea6b84f4899b469e8edff4bf6d22 Talk