{"action":"created","comment":{"url":"https://api.github.com/repos/Shopify/money/pulls/comments/104751941","pull_request_review_id":25602607,"id":104751941,"diff_hunk":"@@ -6,6 +6,10 @@ class Money\n \n   attr_reader :value, :cents\n \n+  def self.from_amount(value)\n+    new(value)\n+  end","path":"lib/money/money.rb","position":6,"original_position":6,"commit_id":"c2cedca7809b7c320489f14fda50bd74c793f64b","original_commit_id":"c2cedca7809b7c320489f14fda50bd74c793f64b","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":"what happens when someone passes a currency here? Example: https://github.com/activemerchant/offsite_payments/blob/71f6cdcdfaeb7a35acd5e525d8f86565234778e8/lib/offsite_payments/integrations/easy_pay.rb#L104","created_at":"2017-03-07T19:09:53Z","updated_at":"2017-03-07T19:09:53Z","html_url":"https://github.com/Shopify/money/pull/44#discussion_r104751941","pull_request_url":"https://api.github.com/repos/Shopify/money/pulls/44","_links":{"self":{"href":"https://api.github.com/repos/Shopify/money/pulls/comments/104751941"},"html":{"href":"https://github.com/Shopify/money/pull/44#discussion_r104751941"},"pull_request":{"href":"https://api.github.com/repos/Shopify/money/pulls/44"}}},"pull_request":{"url":"https://api.github.com/repos/Shopify/money/pulls/44","id":109546253,"html_url":"https://github.com/Shopify/money/pull/44","diff_url":"https://github.com/Shopify/money/pull/44.diff","patch_url":"https://github.com/Shopify/money/pull/44.patch","issue_url":"https://api.github.com/repos/Shopify/money/issues/44","number":44,"state":"open","locked":false,"title":"Introduce Money.from_amount for compatibility with RubyMoney","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":"…and by extension offsite_payments.\r\n\r\nShopifyMoney.new calls `#value_to_decimal` to either cast a Numeric object to BigDecimal, or have BigDecimal parse the input value. RubyMoney [does something similar for .from_amount](https://github.com/RubyMoney/money/blob/557561ef7259b8d2ab6a3603d0a5335e90842644/lib/money/money.rb#L216-L236).","created_at":"2017-03-07T18:53:47Z","updated_at":"2017-03-07T19:09:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c142ef69992b51190c6449856f953a610dbc336e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Shopify/money/pulls/44/commits","review_comments_url":"https://api.github.com/repos/Shopify/money/pulls/44/comments","review_comment_url":"https://api.github.com/repos/Shopify/money/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Shopify/money/issues/44/comments","statuses_url":"https://api.github.com/repos/Shopify/money/statuses/c2cedca7809b7c320489f14fda50bd74c793f64b","head":{"label":"Shopify:from_amount","ref":"from_amount","sha":"c2cedca7809b7c320489f14fda50bd74c793f64b","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-01-20T10:00:40Z","pushed_at":"2017-03-07T18:53:48Z","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":79,"stargazers_count":39,"watchers_count":39,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":7,"mirror_url":null,"open_issues_count":5,"forks":7,"open_issues":5,"watchers":39,"default_branch":"master"}},"base":{"label":"Shopify:master","ref":"master","sha":"dae8e8281404d3cf5d5653e94c416ed485ae69a9","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-01-20T10:00:40Z","pushed_at":"2017-03-07T18:53:48Z","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":79,"stargazers_count":39,"watchers_count":39,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":7,"mirror_url":null,"open_issues_count":5,"forks":7,"open_issues":5,"watchers":39,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Shopify/money/pulls/44"},"html":{"href":"https://github.com/Shopify/money/pull/44"},"issue":{"href":"https://api.github.com/repos/Shopify/money/issues/44"},"comments":{"href":"https://api.github.com/repos/Shopify/money/issues/44/comments"},"review_comments":{"href":"https://api.github.com/repos/Shopify/money/pulls/44/comments"},"review_comment":{"href":"https://api.github.com/repos/Shopify/money/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Shopify/money/pulls/44/commits"},"statuses":{"href":"https://api.github.com/repos/Shopify/money/statuses/c2cedca7809b7c320489f14fda50bd74c793f64b"}}}}
{"actor":{"display_login":"elfassy"}}