Skip to content

Instantly share code, notes, and snippets.

@cbmeeks
Created December 29, 2010 01:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cbmeeks/758019 to your computer and use it in GitHub Desktop.
Save cbmeeks/758019 to your computer and use it in GitHub Desktop.
if k == "ActivityObject"
if @tripit_trip[k].is_a?(Hash)
@tripit_trip[k]["ObjectType"] = "ActivityObject"
tmp[ @tripit_trip[k]["StartDateTime"]["date"] ] = [] if tmp[ @tripit_trip[k]["StartDateTime"]["date"] ].nil?
tmp[ @tripit_trip[k]["StartDateTime"]["date"] ] << @tripit_trip[k]
elsif @tripit_trip[k].is_a?(Array)
@tripit_trip[k].sort_by { |h| h["StartDateTime"]["date"] }.each do |o|
o["ObjectType"] = "ActivityObject"
tmp[ o["StartDateTime"]["date"] ] = [] if tmp[ o["StartDateTime"]["date"] ].nil?
tmp[ o["StartDateTime"]["date"] ] << o
end
end
elsif k == "DirectionsObject"
......
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment