Skip to content

Instantly share code, notes, and snippets.

@seanstickle
Forked from kuon/gist:4141603
Created November 24, 2012 22:22
Show Gist options
  • Select an option

  • Save seanstickle/4141639 to your computer and use it in GitHub Desktop.

Select an option

Save seanstickle/4141639 to your computer and use it in GitHub Desktop.

Revisions

  1. Sean Stickle revised this gist Nov 24, 2012. No changes.
  2. Sean Stickle revised this gist Nov 24, 2012. 1 changed file with 3 additions and 9 deletions.
    12 changes: 3 additions & 9 deletions gistfile1.rb
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,3 @@
    hash = {}
    a.resource_sets.each do |set|
    r = set.resource
    hash[set.key] = {
    :id => r.id,
    :url => r.url
    }
    end
    hash
    a.resource_sets.reduce({}) do |a, x|
    a[x.key] = { id: x.resource.id, url: x.resource.url }; a
    end
  3. @kuon kuon created this gist Nov 24, 2012.
    9 changes: 9 additions & 0 deletions gistfile1.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    hash = {}
    a.resource_sets.each do |set|
    r = set.resource
    hash[set.key] = {
    :id => r.id,
    :url => r.url
    }
    end
    hash