Skip to content

Instantly share code, notes, and snippets.

@tuxfight3r
Last active August 29, 2015 14:10
Show Gist options
  • Select an option

  • Save tuxfight3r/be4f930a8b055ac932ea to your computer and use it in GitHub Desktop.

Select an option

Save tuxfight3r/be4f930a8b055ac932ea to your computer and use it in GitHub Desktop.
ruby manipulate array with map
#ruby manipulate array values with map
irb(main):040:0> array=%w(one two three four five)
=> ["one", "two", "three", "four", "five"]
irb(main):042:0> array.map{|item| "ldap://#{item}" }.join(',')
=> "ldap://one,ldap://two,ldap://three,ldap://four,ldap://five"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment