{"action":"created","comment":{"url":"https://api.github.com/repos/Shopify/money/pulls/comments/123402825","pull_request_review_id":45602134,"id":123402825,"diff_hunk":"@@ -0,0 +1,72 @@\n+class Money\n+  class Currency\n+    class UnknownCurrency < ArgumentError; end\n+\n+    CURRENCY_DATA_PATH = \"#{File.expand_path('../../../config', __FILE__)}/currency_iso.json\".freeze\n+\n+    @@mutex = Mutex.new\n+\n+    attr_reader :priority, :iso_code, :iso_numeric, :name, :symbol,\n+      :disambiguate_symbol, :html_entity, :subunit, :subunit_to_unit, :decimal_mark,\n+      :thousands_separator, :symbol_first, :smallest_denomination, :alternate_symbols\n+\n+    class << self\n+      def new(currency_iso)\n+        iso = currency_iso.to_s.downcase\n+        loaded_currencies[iso] || @@mutex.synchronize { loaded_currencies[iso] = super(iso) }\n+      end\n+      alias_method :find, :new\n+\n+      def loaded_currencies\n+        @loaded_currencies ||= {}\n+      end\n+\n+      def currencies_json\n+        @@currencies_json ||= begin\n+          json = File.read(CURRENCY_DATA_PATH)\n+          json.force_encoding(::Encoding::UTF_8) if defined?(::Encoding)\n+          JSON.parse(json)\n+        end\n+      end\n+    end\n+    currencies_json\n+\n+    def initialize(currency_iso)\n+      return nil if currency_iso.blank?\n+      unless data = self.class.currencies_json[currency_iso]\n+        raise UnknownCurrency, \"Unknown currency '#{currency_iso}'\"\n+      end\n+      @alternate_symbols     = data['alternate_symbols']\n+      @decimal_mark          = data['decimal_mark']","path":"lib/money/currency.rb","position":40,"original_position":40,"commit_id":"07613583f9468376cba4a995ed70cd92b9724eba","original_commit_id":"07613583f9468376cba4a995ed70cd92b9724eba","user":{"login":"bdewater","id":496367,"avatar_url":"https://avatars2.githubusercontent.com/u/496367?v=3","gravatar_id":"","url":"https://api.github.com/users/bdewater","html_url":"https://github.com/bdewater","followers_url":"https://api.github.com/users/bdewater/followers","following_url":"https://api.github.com/users/bdewater/following{/other_user}","gists_url":"https://api.github.com/users/bdewater/gists{/gist_id}","starred_url":"https://api.github.com/users/bdewater/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdewater/subscriptions","organizations_url":"https://api.github.com/users/bdewater/orgs","repos_url":"https://api.github.com/users/bdewater/repos","events_url":"https://api.github.com/users/bdewater/events{/privacy}","received_events_url":"https://api.github.com/users/bdewater/received_events","type":"User","site_admin":false},"body":"As discussed today we should remove this and thousands_separator as these are properties from the locale and not from the currency.","created_at":"2017-06-22T01:25:10Z","updated_at":"2017-06-22T01:57:07Z","html_url":"https://github.com/Shopify/money/pull/59#discussion_r123402825","pull_request_url":"https://api.github.com/repos/Shopify/money/pulls/59","_links":{"self":{"href":"https://api.github.com/repos/Shopify/money/pulls/comments/123402825"},"html":{"href":"https://github.com/Shopify/money/pull/59#discussion_r123402825"},"pull_request":{"href":"https://api.github.com/repos/Shopify/money/pulls/59"}}},"pull_request":{"url":"https://api.github.com/repos/Shopify/money/pulls/59","id":125675450,"html_url":"https://github.com/Shopify/money/pull/59","diff_url":"https://github.com/Shopify/money/pull/59.diff","patch_url":"https://github.com/Shopify/money/pull/59.patch","issue_url":"https://api.github.com/repos/Shopify/money/issues/59","number":59,"state":"open","locked":false,"title":"Currency support","user":{"login":"elfassy","id":311279,"avatar_url":"https://avatars2.githubusercontent.com/u/311279?v=3","gravatar_id":"","url":"https://api.github.com/users/elfassy","html_url":"https://github.com/elfassy","followers_url":"https://api.github.com/users/elfassy/followers","following_url":"https://api.github.com/users/elfassy/following{/other_user}","gists_url":"https://api.github.com/users/elfassy/gists{/gist_id}","starred_url":"https://api.github.com/users/elfassy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elfassy/subscriptions","organizations_url":"https://api.github.com/users/elfassy/orgs","repos_url":"https://api.github.com/users/elfassy/repos","events_url":"https://api.github.com/users/elfassy/events{/privacy}","received_events_url":"https://api.github.com/users/elfassy/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-06-14T19:33:51Z","updated_at":"2017-06-22T01:57:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a6faba9fae9c3f4e796131ea908a75d9c4136290","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/Shopify/money/pulls/59/commits","review_comments_url":"https://api.github.com/repos/Shopify/money/pulls/59/comments","review_comment_url":"https://api.github.com/repos/Shopify/money/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Shopify/money/issues/59/comments","statuses_url":"https://api.github.com/repos/Shopify/money/statuses/07613583f9468376cba4a995ed70cd92b9724eba","head":{"label":"Shopify:currency_constructor","ref":"currency_constructor","sha":"07613583f9468376cba4a995ed70cd92b9724eba","user":{"login":"Shopify","id":8085,"avatar_url":"https://avatars2.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"repo":{"id":1795802,"name":"money","full_name":"Shopify/money","owner":{"login":"Shopify","id":8085,"avatar_url":"https://avatars2.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Shopify/money","description":"Manage money in Shopify with a class that won't lose pennies during division","fork":false,"url":"https://api.github.com/repos/Shopify/money","forks_url":"https://api.github.com/repos/Shopify/money/forks","keys_url":"https://api.github.com/repos/Shopify/money/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Shopify/money/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Shopify/money/teams","hooks_url":"https://api.github.com/repos/Shopify/money/hooks","issue_events_url":"https://api.github.com/repos/Shopify/money/issues/events{/number}","events_url":"https://api.github.com/repos/Shopify/money/events","assignees_url":"https://api.github.com/repos/Shopify/money/assignees{/user}","branches_url":"https://api.github.com/repos/Shopify/money/branches{/branch}","tags_url":"https://api.github.com/repos/Shopify/money/tags","blobs_url":"https://api.github.com/repos/Shopify/money/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Shopify/money/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Shopify/money/git/refs{/sha}","trees_url":"https://api.github.com/repos/Shopify/money/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Shopify/money/statuses/{sha}","languages_url":"https://api.github.com/repos/Shopify/money/languages","stargazers_url":"https://api.github.com/repos/Shopify/money/stargazers","contributors_url":"https://api.github.com/repos/Shopify/money/contributors","subscribers_url":"https://api.github.com/repos/Shopify/money/subscribers","subscription_url":"https://api.github.com/repos/Shopify/money/subscription","commits_url":"https://api.github.com/repos/Shopify/money/commits{/sha}","git_commits_url":"https://api.github.com/repos/Shopify/money/git/commits{/sha}","comments_url":"https://api.github.com/repos/Shopify/money/comments{/number}","issue_comment_url":"https://api.github.com/repos/Shopify/money/issues/comments{/number}","contents_url":"https://api.github.com/repos/Shopify/money/contents/{+path}","compare_url":"https://api.github.com/repos/Shopify/money/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Shopify/money/merges","archive_url":"https://api.github.com/repos/Shopify/money/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Shopify/money/downloads","issues_url":"https://api.github.com/repos/Shopify/money/issues{/number}","pulls_url":"https://api.github.com/repos/Shopify/money/pulls{/number}","milestones_url":"https://api.github.com/repos/Shopify/money/milestones{/number}","notifications_url":"https://api.github.com/repos/Shopify/money/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Shopify/money/labels{/name}","releases_url":"https://api.github.com/repos/Shopify/money/releases{/id}","deployments_url":"https://api.github.com/repos/Shopify/money/deployments","created_at":"2011-05-24T21:20:05Z","updated_at":"2017-06-15T16:20:22Z","pushed_at":"2017-06-20T19:56:23Z","git_url":"git://github.com/Shopify/money.git","ssh_url":"git@github.com:Shopify/money.git","clone_url":"https://github.com/Shopify/money.git","svn_url":"https://github.com/Shopify/money","homepage":"http://shopify.github.io/money","size":115,"stargazers_count":49,"watchers_count":49,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":9,"mirror_url":null,"open_issues_count":8,"forks":9,"open_issues":8,"watchers":49,"default_branch":"master"}},"base":{"label":"Shopify:master","ref":"master","sha":"ffc45912a3775794d36ae1bf6e00389532b0571b","user":{"login":"Shopify","id":8085,"avatar_url":"https://avatars2.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"repo":{"id":1795802,"name":"money","full_name":"Shopify/money","owner":{"login":"Shopify","id":8085,"avatar_url":"https://avatars2.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Shopify/money","description":"Manage money in Shopify with a class that won't lose pennies during division","fork":false,"url":"https://api.github.com/repos/Shopify/money","forks_url":"https://api.github.com/repos/Shopify/money/forks","keys_url":"https://api.github.com/repos/Shopify/money/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Shopify/money/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Shopify/money/teams","hooks_url":"https://api.github.com/repos/Shopify/money/hooks","issue_events_url":"https://api.github.com/repos/Shopify/money/issues/events{/number}","events_url":"https://api.github.com/repos/Shopify/money/events","assignees_url":"https://api.github.com/repos/Shopify/money/assignees{/user}","branches_url":"https://api.github.com/repos/Shopify/money/branches{/branch}","tags_url":"https://api.github.com/repos/Shopify/money/tags","blobs_url":"https://api.github.com/repos/Shopify/money/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Shopify/money/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Shopify/money/git/refs{/sha}","trees_url":"https://api.github.com/repos/Shopify/money/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Shopify/money/statuses/{sha}","languages_url":"https://api.github.com/repos/Shopify/money/languages","stargazers_url":"https://api.github.com/repos/Shopify/money/stargazers","contributors_url":"https://api.github.com/repos/Shopify/money/contributors","subscribers_url":"https://api.github.com/repos/Shopify/money/subscribers","subscription_url":"https://api.github.com/repos/Shopify/money/subscription","commits_url":"https://api.github.com/repos/Shopify/money/commits{/sha}","git_commits_url":"https://api.github.com/repos/Shopify/money/git/commits{/sha}","comments_url":"https://api.github.com/repos/Shopify/money/comments{/number}","issue_comment_url":"https://api.github.com/repos/Shopify/money/issues/comments{/number}","contents_url":"https://api.github.com/repos/Shopify/money/contents/{+path}","compare_url":"https://api.github.com/repos/Shopify/money/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Shopify/money/merges","archive_url":"https://api.github.com/repos/Shopify/money/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Shopify/money/downloads","issues_url":"https://api.github.com/repos/Shopify/money/issues{/number}","pulls_url":"https://api.github.com/repos/Shopify/money/pulls{/number}","milestones_url":"https://api.github.com/repos/Shopify/money/milestones{/number}","notifications_url":"https://api.github.com/repos/Shopify/money/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Shopify/money/labels{/name}","releases_url":"https://api.github.com/repos/Shopify/money/releases{/id}","deployments_url":"https://api.github.com/repos/Shopify/money/deployments","created_at":"2011-05-24T21:20:05Z","updated_at":"2017-06-15T16:20:22Z","pushed_at":"2017-06-20T19:56:23Z","git_url":"git://github.com/Shopify/money.git","ssh_url":"git@github.com:Shopify/money.git","clone_url":"https://github.com/Shopify/money.git","svn_url":"https://github.com/Shopify/money","homepage":"http://shopify.github.io/money","size":115,"stargazers_count":49,"watchers_count":49,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":9,"mirror_url":null,"open_issues_count":8,"forks":9,"open_issues":8,"watchers":49,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Shopify/money/pulls/59"},"html":{"href":"https://github.com/Shopify/money/pull/59"},"issue":{"href":"https://api.github.com/repos/Shopify/money/issues/59"},"comments":{"href":"https://api.github.com/repos/Shopify/money/issues/59/comments"},"review_comments":{"href":"https://api.github.com/repos/Shopify/money/pulls/59/comments"},"review_comment":{"href":"https://api.github.com/repos/Shopify/money/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Shopify/money/pulls/59/commits"},"statuses":{"href":"https://api.github.com/repos/Shopify/money/statuses/07613583f9468376cba4a995ed70cd92b9724eba"}}}}
{"actor":{"display_login":"bdewater"}}