Created
January 13, 2021 09:13
-
-
Save cabb/2752f8698671bc721fa558fede3d0134 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
organization_obj = [] | |
10.times.each do |_i| | |
organization_obj << | |
{ :name => 'names.sample', | |
:title => 'title.sample', | |
:salary => rand(50000..100000) | |
} | |
end | |
organization_obj.map { |x| x[:salary] = '$ ' + x[:salary].to_s } | |
pp organization_obj | |
############## | |
organization_obj = [] | |
10.times.each do |_i| | |
organization_obj << | |
{ name: 'names.sample', | |
title: 'title.sample', | |
salary: rand(50_000..100_000) } | |
end | |
organization_obj.map { |x| x[:salary] = '$ ' + x[:salary].to_s } | |
pp organization_obj |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
works without errors in ruby 2.5.5