Last active
August 29, 2015 14:01
-
-
Save basmoura/155b3d8cad251821448b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
require 'open-uri' | |
def convert_json_to_object | |
emp_json = JSON.parse(open("json_url").read)) | |
emp_json.each do |emp| | |
employee = Employee.new | |
employee[:name] = emp["name"] | |
employee[:cpf] = emp["cpf"] | |
employee[:email] = emp["email"] | |
employee.save | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment