{"action":"created","comment":{"url":"https://api.github.com/repos/QuantoVale/backendRails/pulls/comments/40979963","id":40979963,"diff_hunk":"@@ -0,0 +1,44 @@\n+require 'httparty'\n+\n+\n+class Contrato < ActiveRecord::Base\n+\n+\n+  def parseContrato\n+\n+    #Usando a gem HTTParty para realizar a leitura do JSON da API\n+    response = HTTParty.get('http://compras.dados.gov.br/contratos/v1/contratos.json')\n+      data_hash = response['_embedded']\n+      data = data_hash['contratos']\n+\n+\n+      #Estrutura de repetição usada para passar por todo JSON da API\n+      data.each do |item|\n+        #Estrututa de leitura do API\n+        # :atributoModel => item('atributoAPI')\n+        #Criando uma nova instancia do contrato e atribuindo valores\n+        #que serão retirados da API\n+            u = Contrato.new(\n+            :identificadorContrato => item['Identificador'],\n+            :uasg => item['uasg'],\n+            :modalidadeLicitacao => item['modalidade_licitacao'],\n+            :codigoContrato => item['codigo_contrato'],\n+            :licitacaoAssociada => item['licitacao_associada'],\n+            :objeto => item['objeto'],\n+            :numeroAditivos => item['numero_aditivo'],\n+            :numeroProcessos => item['numero_processo'],\n+            :CPFContratada => item['cnpj_contratada'],\n+            :dataAssinatura => item['data_assinatura'],\n+            :fundamentoGeral => item['fundamento_geral'],\n+            :dataInicioVigencia => item['data_inicio_vigencia'],\n+            :dataTerminoVigencia => item['data_termino_vigencia'],","path":"app/models/contrato.rb","position":34,"original_position":34,"commit_id":"69f36b87d13c588a1b1cf7a138f4c2c2d2b8bbed","original_commit_id":"69f36b87d13c588a1b1cf7a138f4c2c2d2b8bbed","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Use the new Ruby 1.9 hash syntax.<br>Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.","created_at":"2015-10-01T23:41:58Z","updated_at":"2015-10-01T23:41:58Z","html_url":"https://github.com/QuantoVale/backendRails/pull/1#discussion_r40979963","pull_request_url":"https://api.github.com/repos/QuantoVale/backendRails/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/QuantoVale/backendRails/pulls/comments/40979963"},"html":{"href":"https://github.com/QuantoVale/backendRails/pull/1#discussion_r40979963"},"pull_request":{"href":"https://api.github.com/repos/QuantoVale/backendRails/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/QuantoVale/backendRails/pulls/1","id":46590241,"html_url":"https://github.com/QuantoVale/backendRails/pull/1","diff_url":"https://github.com/QuantoVale/backendRails/pull/1.diff","patch_url":"https://github.com/QuantoVale/backendRails/pull/1.patch","issue_url":"https://api.github.com/repos/QuantoVale/backendRails/issues/1","number":1,"state":"open","locked":false,"title":"Contratos","user":{"login":"joao-henrique","id":3011061,"avatar_url":"https://avatars.githubusercontent.com/u/3011061?v=3","gravatar_id":"","url":"https://api.github.com/users/joao-henrique","html_url":"https://github.com/joao-henrique","followers_url":"https://api.github.com/users/joao-henrique/followers","following_url":"https://api.github.com/users/joao-henrique/following{/other_user}","gists_url":"https://api.github.com/users/joao-henrique/gists{/gist_id}","starred_url":"https://api.github.com/users/joao-henrique/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joao-henrique/subscriptions","organizations_url":"https://api.github.com/users/joao-henrique/orgs","repos_url":"https://api.github.com/users/joao-henrique/repos","events_url":"https://api.github.com/users/joao-henrique/events{/privacy}","received_events_url":"https://api.github.com/users/joao-henrique/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-01T23:41:51Z","updated_at":"2015-10-01T23:41:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4f7d2a4b7bc76ec21b96348bc11fb7f644194493","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/QuantoVale/backendRails/pulls/1/commits","review_comments_url":"https://api.github.com/repos/QuantoVale/backendRails/pulls/1/comments","review_comment_url":"https://api.github.com/repos/QuantoVale/backendRails/pulls/comments{/number}","comments_url":"https://api.github.com/repos/QuantoVale/backendRails/issues/1/comments","statuses_url":"https://api.github.com/repos/QuantoVale/backendRails/statuses/69f36b87d13c588a1b1cf7a138f4c2c2d2b8bbed","head":{"label":"QuantoVale:contratos","ref":"contratos","sha":"69f36b87d13c588a1b1cf7a138f4c2c2d2b8bbed","user":{"login":"QuantoVale","id":14047688,"avatar_url":"https://avatars.githubusercontent.com/u/14047688?v=3","gravatar_id":"","url":"https://api.github.com/users/QuantoVale","html_url":"https://github.com/QuantoVale","followers_url":"https://api.github.com/users/QuantoVale/followers","following_url":"https://api.github.com/users/QuantoVale/following{/other_user}","gists_url":"https://api.github.com/users/QuantoVale/gists{/gist_id}","starred_url":"https://api.github.com/users/QuantoVale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/QuantoVale/subscriptions","organizations_url":"https://api.github.com/users/QuantoVale/orgs","repos_url":"https://api.github.com/users/QuantoVale/repos","events_url":"https://api.github.com/users/QuantoVale/events{/privacy}","received_events_url":"https://api.github.com/users/QuantoVale/received_events","type":"Organization","site_admin":false},"repo":{"id":41652241,"name":"backendRails","full_name":"QuantoVale/backendRails","owner":{"login":"QuantoVale","id":14047688,"avatar_url":"https://avatars.githubusercontent.com/u/14047688?v=3","gravatar_id":"","url":"https://api.github.com/users/QuantoVale","html_url":"https://github.com/QuantoVale","followers_url":"https://api.github.com/users/QuantoVale/followers","following_url":"https://api.github.com/users/QuantoVale/following{/other_user}","gists_url":"https://api.github.com/users/QuantoVale/gists{/gist_id}","starred_url":"https://api.github.com/users/QuantoVale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/QuantoVale/subscriptions","organizations_url":"https://api.github.com/users/QuantoVale/orgs","repos_url":"https://api.github.com/users/QuantoVale/repos","events_url":"https://api.github.com/users/QuantoVale/events{/privacy}","received_events_url":"https://api.github.com/users/QuantoVale/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/QuantoVale/backendRails","description":"","fork":false,"url":"https://api.github.com/repos/QuantoVale/backendRails","forks_url":"https://api.github.com/repos/QuantoVale/backendRails/forks","keys_url":"https://api.github.com/repos/QuantoVale/backendRails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/QuantoVale/backendRails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/QuantoVale/backendRails/teams","hooks_url":"https://api.github.com/repos/QuantoVale/backendRails/hooks","issue_events_url":"https://api.github.com/repos/QuantoVale/backendRails/issues/events{/number}","events_url":"https://api.github.com/repos/QuantoVale/backendRails/events","assignees_url":"https://api.github.com/repos/QuantoVale/backendRails/assignees{/user}","branches_url":"https://api.github.com/repos/QuantoVale/backendRails/branches{/branch}","tags_url":"https://api.github.com/repos/QuantoVale/backendRails/tags","blobs_url":"https://api.github.com/repos/QuantoVale/backendRails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/QuantoVale/backendRails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/QuantoVale/backendRails/git/refs{/sha}","trees_url":"https://api.github.com/repos/QuantoVale/backendRails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/QuantoVale/backendRails/statuses/{sha}","languages_url":"https://api.github.com/repos/QuantoVale/backendRails/languages","stargazers_url":"https://api.github.com/repos/QuantoVale/backendRails/stargazers","contributors_url":"https://api.github.com/repos/QuantoVale/backendRails/contributors","subscribers_url":"https://api.github.com/repos/QuantoVale/backendRails/subscribers","subscription_url":"https://api.github.com/repos/QuantoVale/backendRails/subscription","commits_url":"https://api.github.com/repos/QuantoVale/backendRails/commits{/sha}","git_commits_url":"https://api.github.com/repos/QuantoVale/backendRails/git/commits{/sha}","comments_url":"https://api.github.com/repos/QuantoVale/backendRails/comments{/number}","issue_comment_url":"https://api.github.com/repos/QuantoVale/backendRails/issues/comments{/number}","contents_url":"https://api.github.com/repos/QuantoVale/backendRails/contents/{+path}","compare_url":"https://api.github.com/repos/QuantoVale/backendRails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/QuantoVale/backendRails/merges","archive_url":"https://api.github.com/repos/QuantoVale/backendRails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/QuantoVale/backendRails/downloads","issues_url":"https://api.github.com/repos/QuantoVale/backendRails/issues{/number}","pulls_url":"https://api.github.com/repos/QuantoVale/backendRails/pulls{/number}","milestones_url":"https://api.github.com/repos/QuantoVale/backendRails/milestones{/number}","notifications_url":"https://api.github.com/repos/QuantoVale/backendRails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/QuantoVale/backendRails/labels{/name}","releases_url":"https://api.github.com/repos/QuantoVale/backendRails/releases{/id}","created_at":"2015-08-31T02:48:19Z","updated_at":"2015-09-17T01:35:30Z","pushed_at":"2015-10-01T23:41:52Z","git_url":"git://github.com/QuantoVale/backendRails.git","ssh_url":"git@github.com:QuantoVale/backendRails.git","clone_url":"https://github.com/QuantoVale/backendRails.git","svn_url":"https://github.com/QuantoVale/backendRails","homepage":null,"size":228,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"QuantoVale:master","ref":"master","sha":"3fe45b06d7e7548f82602b6c71bcb6eab46970f3","user":{"login":"QuantoVale","id":14047688,"avatar_url":"https://avatars.githubusercontent.com/u/14047688?v=3","gravatar_id":"","url":"https://api.github.com/users/QuantoVale","html_url":"https://github.com/QuantoVale","followers_url":"https://api.github.com/users/QuantoVale/followers","following_url":"https://api.github.com/users/QuantoVale/following{/other_user}","gists_url":"https://api.github.com/users/QuantoVale/gists{/gist_id}","starred_url":"https://api.github.com/users/QuantoVale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/QuantoVale/subscriptions","organizations_url":"https://api.github.com/users/QuantoVale/orgs","repos_url":"https://api.github.com/users/QuantoVale/repos","events_url":"https://api.github.com/users/QuantoVale/events{/privacy}","received_events_url":"https://api.github.com/users/QuantoVale/received_events","type":"Organization","site_admin":false},"repo":{"id":41652241,"name":"backendRails","full_name":"QuantoVale/backendRails","owner":{"login":"QuantoVale","id":14047688,"avatar_url":"https://avatars.githubusercontent.com/u/14047688?v=3","gravatar_id":"","url":"https://api.github.com/users/QuantoVale","html_url":"https://github.com/QuantoVale","followers_url":"https://api.github.com/users/QuantoVale/followers","following_url":"https://api.github.com/users/QuantoVale/following{/other_user}","gists_url":"https://api.github.com/users/QuantoVale/gists{/gist_id}","starred_url":"https://api.github.com/users/QuantoVale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/QuantoVale/subscriptions","organizations_url":"https://api.github.com/users/QuantoVale/orgs","repos_url":"https://api.github.com/users/QuantoVale/repos","events_url":"https://api.github.com/users/QuantoVale/events{/privacy}","received_events_url":"https://api.github.com/users/QuantoVale/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/QuantoVale/backendRails","description":"","fork":false,"url":"https://api.github.com/repos/QuantoVale/backendRails","forks_url":"https://api.github.com/repos/QuantoVale/backendRails/forks","keys_url":"https://api.github.com/repos/QuantoVale/backendRails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/QuantoVale/backendRails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/QuantoVale/backendRails/teams","hooks_url":"https://api.github.com/repos/QuantoVale/backendRails/hooks","issue_events_url":"https://api.github.com/repos/QuantoVale/backendRails/issues/events{/number}","events_url":"https://api.github.com/repos/QuantoVale/backendRails/events","assignees_url":"https://api.github.com/repos/QuantoVale/backendRails/assignees{/user}","branches_url":"https://api.github.com/repos/QuantoVale/backendRails/branches{/branch}","tags_url":"https://api.github.com/repos/QuantoVale/backendRails/tags","blobs_url":"https://api.github.com/repos/QuantoVale/backendRails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/QuantoVale/backendRails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/QuantoVale/backendRails/git/refs{/sha}","trees_url":"https://api.github.com/repos/QuantoVale/backendRails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/QuantoVale/backendRails/statuses/{sha}","languages_url":"https://api.github.com/repos/QuantoVale/backendRails/languages","stargazers_url":"https://api.github.com/repos/QuantoVale/backendRails/stargazers","contributors_url":"https://api.github.com/repos/QuantoVale/backendRails/contributors","subscribers_url":"https://api.github.com/repos/QuantoVale/backendRails/subscribers","subscription_url":"https://api.github.com/repos/QuantoVale/backendRails/subscription","commits_url":"https://api.github.com/repos/QuantoVale/backendRails/commits{/sha}","git_commits_url":"https://api.github.com/repos/QuantoVale/backendRails/git/commits{/sha}","comments_url":"https://api.github.com/repos/QuantoVale/backendRails/comments{/number}","issue_comment_url":"https://api.github.com/repos/QuantoVale/backendRails/issues/comments{/number}","contents_url":"https://api.github.com/repos/QuantoVale/backendRails/contents/{+path}","compare_url":"https://api.github.com/repos/QuantoVale/backendRails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/QuantoVale/backendRails/merges","archive_url":"https://api.github.com/repos/QuantoVale/backendRails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/QuantoVale/backendRails/downloads","issues_url":"https://api.github.com/repos/QuantoVale/backendRails/issues{/number}","pulls_url":"https://api.github.com/repos/QuantoVale/backendRails/pulls{/number}","milestones_url":"https://api.github.com/repos/QuantoVale/backendRails/milestones{/number}","notifications_url":"https://api.github.com/repos/QuantoVale/backendRails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/QuantoVale/backendRails/labels{/name}","releases_url":"https://api.github.com/repos/QuantoVale/backendRails/releases{/id}","created_at":"2015-08-31T02:48:19Z","updated_at":"2015-09-17T01:35:30Z","pushed_at":"2015-10-01T23:41:52Z","git_url":"git://github.com/QuantoVale/backendRails.git","ssh_url":"git@github.com:QuantoVale/backendRails.git","clone_url":"https://github.com/QuantoVale/backendRails.git","svn_url":"https://github.com/QuantoVale/backendRails","homepage":null,"size":228,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/QuantoVale/backendRails/pulls/1"},"html":{"href":"https://github.com/QuantoVale/backendRails/pull/1"},"issue":{"href":"https://api.github.com/repos/QuantoVale/backendRails/issues/1"},"comments":{"href":"https://api.github.com/repos/QuantoVale/backendRails/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/QuantoVale/backendRails/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/QuantoVale/backendRails/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/QuantoVale/backendRails/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/QuantoVale/backendRails/statuses/69f36b87d13c588a1b1cf7a138f4c2c2d2b8bbed"}}}}