public
Created

  • Download Gist
TripIt.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14
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"
......

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.