Guest User

Untitled

a guest
Feb 20th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. module Enumerable
  2. def inject_with_index(*args, &block)
  3. enum_for(:each_with_index).inject(*args, &block)
  4. end
  5. end
  6.  
  7. spots = (data = surfline_data.to_hash)[:spot_name].split(',').inject_with_index(Hash.new) {|hash, (name, i)| hash[name] = data[:spot_url].split(',')[i] }
Add Comment
Please, Sign In to add comment