{"action":"created","comment":{"url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/pulls/comments/27215827","id":27215827,"diff_hunk":"@@ -0,0 +1,51 @@\n+require 'bigdecimal'\n+\n+module Ecommerce\n+  class AttributeHandler\n+\n+    KINDS = [:decimal, :date, :datetime]\n+\n+    attr_reader :attribute\n+\n+    def initialize(attribute)\n+      @attribute = attribute\n+    end\n+\n+    def self.handle(attribute)\n+      self.new(attribute).handle\n+    end\n+\n+    def handle\n+      KINDS.each do |kind|\n+        return send(\"as_#{kind}\") if send(\"is_#{kind}?\")\n+      end\n+      attribute\n+    end\n+\n+    private\n+\n+    def is_decimal?","path":"lib/ecommerce/attribute_handler.rb","position":27,"original_position":27,"commit_id":"5363c3f8e1cf2046420be16afcadf52cd02de5d1","original_commit_id":"5363c3f8e1cf2046420be16afcadf52cd02de5d1","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":"Rename `is_decimal?` to `decimal?`.","created_at":"2015-03-26T14:17:15Z","updated_at":"2015-03-26T14:17:15Z","html_url":"https://github.com/myfreecomm/ecommerce-client-ruby/pull/1#discussion_r27215827","pull_request_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/pulls/comments/27215827"},"html":{"href":"https://github.com/myfreecomm/ecommerce-client-ruby/pull/1#discussion_r27215827"},"pull_request":{"href":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/pulls/1","id":31759169,"html_url":"https://github.com/myfreecomm/ecommerce-client-ruby/pull/1","diff_url":"https://github.com/myfreecomm/ecommerce-client-ruby/pull/1.diff","patch_url":"https://github.com/myfreecomm/ecommerce-client-ruby/pull/1.patch","issue_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/issues/1","number":1,"state":"open","locked":false,"title":"WIP - Creates Ecommerce gem","user":{"login":"tauil","id":14328,"avatar_url":"https://avatars.githubusercontent.com/u/14328?v=3","gravatar_id":"","url":"https://api.github.com/users/tauil","html_url":"https://github.com/tauil","followers_url":"https://api.github.com/users/tauil/followers","following_url":"https://api.github.com/users/tauil/following{/other_user}","gists_url":"https://api.github.com/users/tauil/gists{/gist_id}","starred_url":"https://api.github.com/users/tauil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tauil/subscriptions","organizations_url":"https://api.github.com/users/tauil/orgs","repos_url":"https://api.github.com/users/tauil/repos","events_url":"https://api.github.com/users/tauil/events{/privacy}","received_events_url":"https://api.github.com/users/tauil/received_events","type":"User","site_admin":false},"body":"Item from [this card](https://trello.com/c/dgjmOPjK/264-16-4-charging-via-ecommerce-3-ecommerce-integration)","created_at":"2015-03-23T18:15:28Z","updated_at":"2015-03-26T14:17:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"353af2cf21a57bf0a828a46f488061dc66a553a5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/pulls/1/commits","review_comments_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/pulls/1/comments","review_comment_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/pulls/comments{/number}","comments_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/issues/1/comments","statuses_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/statuses/5363c3f8e1cf2046420be16afcadf52cd02de5d1","head":{"label":"myfreecomm:feature-build-gem","ref":"feature-build-gem","sha":"5363c3f8e1cf2046420be16afcadf52cd02de5d1","user":{"login":"myfreecomm","id":86764,"avatar_url":"https://avatars.githubusercontent.com/u/86764?v=3","gravatar_id":"","url":"https://api.github.com/users/myfreecomm","html_url":"https://github.com/myfreecomm","followers_url":"https://api.github.com/users/myfreecomm/followers","following_url":"https://api.github.com/users/myfreecomm/following{/other_user}","gists_url":"https://api.github.com/users/myfreecomm/gists{/gist_id}","starred_url":"https://api.github.com/users/myfreecomm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myfreecomm/subscriptions","organizations_url":"https://api.github.com/users/myfreecomm/orgs","repos_url":"https://api.github.com/users/myfreecomm/repos","events_url":"https://api.github.com/users/myfreecomm/events{/privacy}","received_events_url":"https://api.github.com/users/myfreecomm/received_events","type":"Organization","site_admin":false},"repo":{"id":8864887,"name":"ecommerce-client-ruby","full_name":"myfreecomm/ecommerce-client-ruby","owner":{"login":"myfreecomm","id":86764,"avatar_url":"https://avatars.githubusercontent.com/u/86764?v=3","gravatar_id":"","url":"https://api.github.com/users/myfreecomm","html_url":"https://github.com/myfreecomm","followers_url":"https://api.github.com/users/myfreecomm/followers","following_url":"https://api.github.com/users/myfreecomm/following{/other_user}","gists_url":"https://api.github.com/users/myfreecomm/gists{/gist_id}","starred_url":"https://api.github.com/users/myfreecomm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myfreecomm/subscriptions","organizations_url":"https://api.github.com/users/myfreecomm/orgs","repos_url":"https://api.github.com/users/myfreecomm/repos","events_url":"https://api.github.com/users/myfreecomm/events{/privacy}","received_events_url":"https://api.github.com/users/myfreecomm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/myfreecomm/ecommerce-client-ruby","description":"A Ruby client for Myfreecomm's Ecommerce REST API","fork":false,"url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby","forks_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/forks","keys_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/teams","hooks_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/hooks","issue_events_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/issues/events{/number}","events_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/events","assignees_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/assignees{/user}","branches_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/branches{/branch}","tags_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/tags","blobs_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/statuses/{sha}","languages_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/languages","stargazers_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/stargazers","contributors_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/contributors","subscribers_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/subscribers","subscription_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/subscription","commits_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/contents/{+path}","compare_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/merges","archive_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/downloads","issues_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/issues{/number}","pulls_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/pulls{/number}","milestones_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/milestones{/number}","notifications_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/labels{/name}","releases_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/releases{/id}","created_at":"2013-03-18T21:42:08Z","updated_at":"2014-01-18T02:35:57Z","pushed_at":"2015-03-26T14:17:08Z","git_url":"git://github.com/myfreecomm/ecommerce-client-ruby.git","ssh_url":"git@github.com:myfreecomm/ecommerce-client-ruby.git","clone_url":"https://github.com/myfreecomm/ecommerce-client-ruby.git","svn_url":"https://github.com/myfreecomm/ecommerce-client-ruby","homepage":null,"size":107,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"myfreecomm:master","ref":"master","sha":"8b6478e6227ef4479c2d65bdb03cb19fb865ed90","user":{"login":"myfreecomm","id":86764,"avatar_url":"https://avatars.githubusercontent.com/u/86764?v=3","gravatar_id":"","url":"https://api.github.com/users/myfreecomm","html_url":"https://github.com/myfreecomm","followers_url":"https://api.github.com/users/myfreecomm/followers","following_url":"https://api.github.com/users/myfreecomm/following{/other_user}","gists_url":"https://api.github.com/users/myfreecomm/gists{/gist_id}","starred_url":"https://api.github.com/users/myfreecomm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myfreecomm/subscriptions","organizations_url":"https://api.github.com/users/myfreecomm/orgs","repos_url":"https://api.github.com/users/myfreecomm/repos","events_url":"https://api.github.com/users/myfreecomm/events{/privacy}","received_events_url":"https://api.github.com/users/myfreecomm/received_events","type":"Organization","site_admin":false},"repo":{"id":8864887,"name":"ecommerce-client-ruby","full_name":"myfreecomm/ecommerce-client-ruby","owner":{"login":"myfreecomm","id":86764,"avatar_url":"https://avatars.githubusercontent.com/u/86764?v=3","gravatar_id":"","url":"https://api.github.com/users/myfreecomm","html_url":"https://github.com/myfreecomm","followers_url":"https://api.github.com/users/myfreecomm/followers","following_url":"https://api.github.com/users/myfreecomm/following{/other_user}","gists_url":"https://api.github.com/users/myfreecomm/gists{/gist_id}","starred_url":"https://api.github.com/users/myfreecomm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myfreecomm/subscriptions","organizations_url":"https://api.github.com/users/myfreecomm/orgs","repos_url":"https://api.github.com/users/myfreecomm/repos","events_url":"https://api.github.com/users/myfreecomm/events{/privacy}","received_events_url":"https://api.github.com/users/myfreecomm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/myfreecomm/ecommerce-client-ruby","description":"A Ruby client for Myfreecomm's Ecommerce REST API","fork":false,"url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby","forks_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/forks","keys_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/teams","hooks_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/hooks","issue_events_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/issues/events{/number}","events_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/events","assignees_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/assignees{/user}","branches_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/branches{/branch}","tags_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/tags","blobs_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/statuses/{sha}","languages_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/languages","stargazers_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/stargazers","contributors_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/contributors","subscribers_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/subscribers","subscription_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/subscription","commits_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/contents/{+path}","compare_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/merges","archive_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/downloads","issues_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/issues{/number}","pulls_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/pulls{/number}","milestones_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/milestones{/number}","notifications_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/labels{/name}","releases_url":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/releases{/id}","created_at":"2013-03-18T21:42:08Z","updated_at":"2014-01-18T02:35:57Z","pushed_at":"2015-03-26T14:17:08Z","git_url":"git://github.com/myfreecomm/ecommerce-client-ruby.git","ssh_url":"git@github.com:myfreecomm/ecommerce-client-ruby.git","clone_url":"https://github.com/myfreecomm/ecommerce-client-ruby.git","svn_url":"https://github.com/myfreecomm/ecommerce-client-ruby","homepage":null,"size":107,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/pulls/1"},"html":{"href":"https://github.com/myfreecomm/ecommerce-client-ruby/pull/1"},"issue":{"href":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/issues/1"},"comments":{"href":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/myfreecomm/ecommerce-client-ruby/statuses/5363c3f8e1cf2046420be16afcadf52cd02de5d1"}}}}