Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # intentionally obfuscated copy pasta
- module AddictingIdioms
- def inject_overdose
- object = { :type => "api_object[table]", :properties => ['p1', 'p2'] }
- properties = call_api_thing(object, nil).results.map { |x| x.properties }
- config = properties.inject([]) do |result,property|
- result << {
- property.first.name => property.first.value,
- property.last.name => property.last.value
- }
- end
- return config.map { |c| c["p2"] }.uniq.inject([]) do |result,p|
- result << {
- food: p,
- poop: case p
- when /abc/, /xyz/
- "Hello"
- when /BoobHammer/
- "Bye"
- end,
- boob: config.select { |x| x["p2"] == p }.map { |x| x['p1'] }
- }
- end
- end
- end
- configs = AddictingIdioms.inject_overdose([]) { |result,config| result << CONFIG.merge(config) }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement