{"action":"created","comment":{"url":"https://api.github.com/repos/Yelp/yelp-ruby/pulls/comments/45411171","id":45411171,"diff_hunk":"@@ -3,8 +3,35 @@\n module Yelp\n   module Response\n     module Model\n-      class Rating < Response::Base\n-        attr_reader :rating, :img_url\n+      class Rating\n+        attr_reader :rating\n+\n+        def initialize(json)\n+          @rating = json['rating']\n+          @image  = { regular: json['rating_image_url']       || json['rating_img_url'],\n+                      small:   json['rating_image_small_url'] || json['rating_img_url_small'],\n+                      large:   json['rating_image_large_url'] || json['rating_img_url_large'] }\n+        end\n+\n+        def image_url(size = :regular)\n+          @image[size] if @image[size]\n+        end\n+\n+        def image_small_url\n+          image_url(:small)\n+        end\n+\n+        def image_large_url\n+          image_url(:large)\n+        end\n+\n+        # The naming from the response is consistent (img vs image, url_small vs small_url),\n+        # the aliases try to \"standardize\" them for the end user\n+        alias_method :img_url, :image_url","path":"lib/yelp/responses/models/rating.rb","position":34,"original_position":30,"commit_id":"c6f47c33a85693f5d757e6658f899feb6c8430fa","original_commit_id":"ef014dd701706b39e9936050d9e8eff8e6946b01","user":{"login":"tomelm","id":153050,"avatar_url":"https://avatars.githubusercontent.com/u/153050?v=3","gravatar_id":"","url":"https://api.github.com/users/tomelm","html_url":"https://github.com/tomelm","followers_url":"https://api.github.com/users/tomelm/followers","following_url":"https://api.github.com/users/tomelm/following{/other_user}","gists_url":"https://api.github.com/users/tomelm/gists{/gist_id}","starred_url":"https://api.github.com/users/tomelm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomelm/subscriptions","organizations_url":"https://api.github.com/users/tomelm/orgs","repos_url":"https://api.github.com/users/tomelm/repos","events_url":"https://api.github.com/users/tomelm/events{/privacy}","received_events_url":"https://api.github.com/users/tomelm/received_events","type":"User","site_admin":false},"body":"My rationale behind this was that I'd try to make it work whatever folks tried, although I can see this not being the best idea. I'm leaning towards what you're thinking and only providing `image_url`.\r\n\r\n@mittonk thoughts?","created_at":"2015-11-19T22:32:05Z","updated_at":"2015-11-19T22:32:05Z","html_url":"https://github.com/Yelp/yelp-ruby/pull/41#discussion_r45411171","pull_request_url":"https://api.github.com/repos/Yelp/yelp-ruby/pulls/41","_links":{"self":{"href":"https://api.github.com/repos/Yelp/yelp-ruby/pulls/comments/45411171"},"html":{"href":"https://github.com/Yelp/yelp-ruby/pull/41#discussion_r45411171"},"pull_request":{"href":"https://api.github.com/repos/Yelp/yelp-ruby/pulls/41"}}},"pull_request":{"url":"https://api.github.com/repos/Yelp/yelp-ruby/pulls/41","id":51267683,"html_url":"https://github.com/Yelp/yelp-ruby/pull/41","diff_url":"https://github.com/Yelp/yelp-ruby/pull/41.diff","patch_url":"https://github.com/Yelp/yelp-ruby/pull/41.patch","issue_url":"https://api.github.com/repos/Yelp/yelp-ruby/issues/41","number":41,"state":"open","locked":false,"title":"Handle the rating image url special cases","user":{"login":"tomelm","id":153050,"avatar_url":"https://avatars.githubusercontent.com/u/153050?v=3","gravatar_id":"","url":"https://api.github.com/users/tomelm","html_url":"https://github.com/tomelm","followers_url":"https://api.github.com/users/tomelm/followers","following_url":"https://api.github.com/users/tomelm/following{/other_user}","gists_url":"https://api.github.com/users/tomelm/gists{/gist_id}","starred_url":"https://api.github.com/users/tomelm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomelm/subscriptions","organizations_url":"https://api.github.com/users/tomelm/orgs","repos_url":"https://api.github.com/users/tomelm/repos","events_url":"https://api.github.com/users/tomelm/events{/privacy}","received_events_url":"https://api.github.com/users/tomelm/received_events","type":"User","site_admin":false},"body":"This should deal with #39 a little better","created_at":"2015-11-19T19:20:12Z","updated_at":"2015-11-19T22:32:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f4af47336eb31816912327acdf9ef38e3ebb014a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Yelp/yelp-ruby/pulls/41/commits","review_comments_url":"https://api.github.com/repos/Yelp/yelp-ruby/pulls/41/comments","review_comment_url":"https://api.github.com/repos/Yelp/yelp-ruby/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Yelp/yelp-ruby/issues/41/comments","statuses_url":"https://api.github.com/repos/Yelp/yelp-ruby/statuses/c6f47c33a85693f5d757e6658f899feb6c8430fa","head":{"label":"Yelp:rating-image","ref":"rating-image","sha":"c6f47c33a85693f5d757e6658f899feb6c8430fa","user":{"login":"Yelp","id":49071,"avatar_url":"https://avatars.githubusercontent.com/u/49071?v=3","gravatar_id":"","url":"https://api.github.com/users/Yelp","html_url":"https://github.com/Yelp","followers_url":"https://api.github.com/users/Yelp/followers","following_url":"https://api.github.com/users/Yelp/following{/other_user}","gists_url":"https://api.github.com/users/Yelp/gists{/gist_id}","starred_url":"https://api.github.com/users/Yelp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yelp/subscriptions","organizations_url":"https://api.github.com/users/Yelp/orgs","repos_url":"https://api.github.com/users/Yelp/repos","events_url":"https://api.github.com/users/Yelp/events{/privacy}","received_events_url":"https://api.github.com/users/Yelp/received_events","type":"Organization","site_admin":false},"repo":{"id":18886870,"name":"yelp-ruby","full_name":"Yelp/yelp-ruby","owner":{"login":"Yelp","id":49071,"avatar_url":"https://avatars.githubusercontent.com/u/49071?v=3","gravatar_id":"","url":"https://api.github.com/users/Yelp","html_url":"https://github.com/Yelp","followers_url":"https://api.github.com/users/Yelp/followers","following_url":"https://api.github.com/users/Yelp/following{/other_user}","gists_url":"https://api.github.com/users/Yelp/gists{/gist_id}","starred_url":"https://api.github.com/users/Yelp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yelp/subscriptions","organizations_url":"https://api.github.com/users/Yelp/orgs","repos_url":"https://api.github.com/users/Yelp/repos","events_url":"https://api.github.com/users/Yelp/events{/privacy}","received_events_url":"https://api.github.com/users/Yelp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Yelp/yelp-ruby","description":"A Ruby gem for communicating with the Yelp REST API","fork":false,"url":"https://api.github.com/repos/Yelp/yelp-ruby","forks_url":"https://api.github.com/repos/Yelp/yelp-ruby/forks","keys_url":"https://api.github.com/repos/Yelp/yelp-ruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Yelp/yelp-ruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Yelp/yelp-ruby/teams","hooks_url":"https://api.github.com/repos/Yelp/yelp-ruby/hooks","issue_events_url":"https://api.github.com/repos/Yelp/yelp-ruby/issues/events{/number}","events_url":"https://api.github.com/repos/Yelp/yelp-ruby/events","assignees_url":"https://api.github.com/repos/Yelp/yelp-ruby/assignees{/user}","branches_url":"https://api.github.com/repos/Yelp/yelp-ruby/branches{/branch}","tags_url":"https://api.github.com/repos/Yelp/yelp-ruby/tags","blobs_url":"https://api.github.com/repos/Yelp/yelp-ruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Yelp/yelp-ruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Yelp/yelp-ruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/Yelp/yelp-ruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Yelp/yelp-ruby/statuses/{sha}","languages_url":"https://api.github.com/repos/Yelp/yelp-ruby/languages","stargazers_url":"https://api.github.com/repos/Yelp/yelp-ruby/stargazers","contributors_url":"https://api.github.com/repos/Yelp/yelp-ruby/contributors","subscribers_url":"https://api.github.com/repos/Yelp/yelp-ruby/subscribers","subscription_url":"https://api.github.com/repos/Yelp/yelp-ruby/subscription","commits_url":"https://api.github.com/repos/Yelp/yelp-ruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/Yelp/yelp-ruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/Yelp/yelp-ruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/Yelp/yelp-ruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/Yelp/yelp-ruby/contents/{+path}","compare_url":"https://api.github.com/repos/Yelp/yelp-ruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Yelp/yelp-ruby/merges","archive_url":"https://api.github.com/repos/Yelp/yelp-ruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Yelp/yelp-ruby/downloads","issues_url":"https://api.github.com/repos/Yelp/yelp-ruby/issues{/number}","pulls_url":"https://api.github.com/repos/Yelp/yelp-ruby/pulls{/number}","milestones_url":"https://api.github.com/repos/Yelp/yelp-ruby/milestones{/number}","notifications_url":"https://api.github.com/repos/Yelp/yelp-ruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Yelp/yelp-ruby/labels{/name}","releases_url":"https://api.github.com/repos/Yelp/yelp-ruby/releases{/id}","created_at":"2014-04-17T17:17:23Z","updated_at":"2015-11-05T22:07:52Z","pushed_at":"2015-11-19T19:33:12Z","git_url":"git://github.com/Yelp/yelp-ruby.git","ssh_url":"git@github.com:Yelp/yelp-ruby.git","clone_url":"https://github.com/Yelp/yelp-ruby.git","svn_url":"https://github.com/Yelp/yelp-ruby","homepage":null,"size":344,"stargazers_count":53,"watchers_count":53,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":36,"mirror_url":null,"open_issues_count":3,"forks":36,"open_issues":3,"watchers":53,"default_branch":"develop"}},"base":{"label":"Yelp:develop","ref":"develop","sha":"1bccda1d78ddd328dbae28d78dcd6a331c9d663b","user":{"login":"Yelp","id":49071,"avatar_url":"https://avatars.githubusercontent.com/u/49071?v=3","gravatar_id":"","url":"https://api.github.com/users/Yelp","html_url":"https://github.com/Yelp","followers_url":"https://api.github.com/users/Yelp/followers","following_url":"https://api.github.com/users/Yelp/following{/other_user}","gists_url":"https://api.github.com/users/Yelp/gists{/gist_id}","starred_url":"https://api.github.com/users/Yelp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yelp/subscriptions","organizations_url":"https://api.github.com/users/Yelp/orgs","repos_url":"https://api.github.com/users/Yelp/repos","events_url":"https://api.github.com/users/Yelp/events{/privacy}","received_events_url":"https://api.github.com/users/Yelp/received_events","type":"Organization","site_admin":false},"repo":{"id":18886870,"name":"yelp-ruby","full_name":"Yelp/yelp-ruby","owner":{"login":"Yelp","id":49071,"avatar_url":"https://avatars.githubusercontent.com/u/49071?v=3","gravatar_id":"","url":"https://api.github.com/users/Yelp","html_url":"https://github.com/Yelp","followers_url":"https://api.github.com/users/Yelp/followers","following_url":"https://api.github.com/users/Yelp/following{/other_user}","gists_url":"https://api.github.com/users/Yelp/gists{/gist_id}","starred_url":"https://api.github.com/users/Yelp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yelp/subscriptions","organizations_url":"https://api.github.com/users/Yelp/orgs","repos_url":"https://api.github.com/users/Yelp/repos","events_url":"https://api.github.com/users/Yelp/events{/privacy}","received_events_url":"https://api.github.com/users/Yelp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Yelp/yelp-ruby","description":"A Ruby gem for communicating with the Yelp REST API","fork":false,"url":"https://api.github.com/repos/Yelp/yelp-ruby","forks_url":"https://api.github.com/repos/Yelp/yelp-ruby/forks","keys_url":"https://api.github.com/repos/Yelp/yelp-ruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Yelp/yelp-ruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Yelp/yelp-ruby/teams","hooks_url":"https://api.github.com/repos/Yelp/yelp-ruby/hooks","issue_events_url":"https://api.github.com/repos/Yelp/yelp-ruby/issues/events{/number}","events_url":"https://api.github.com/repos/Yelp/yelp-ruby/events","assignees_url":"https://api.github.com/repos/Yelp/yelp-ruby/assignees{/user}","branches_url":"https://api.github.com/repos/Yelp/yelp-ruby/branches{/branch}","tags_url":"https://api.github.com/repos/Yelp/yelp-ruby/tags","blobs_url":"https://api.github.com/repos/Yelp/yelp-ruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Yelp/yelp-ruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Yelp/yelp-ruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/Yelp/yelp-ruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Yelp/yelp-ruby/statuses/{sha}","languages_url":"https://api.github.com/repos/Yelp/yelp-ruby/languages","stargazers_url":"https://api.github.com/repos/Yelp/yelp-ruby/stargazers","contributors_url":"https://api.github.com/repos/Yelp/yelp-ruby/contributors","subscribers_url":"https://api.github.com/repos/Yelp/yelp-ruby/subscribers","subscription_url":"https://api.github.com/repos/Yelp/yelp-ruby/subscription","commits_url":"https://api.github.com/repos/Yelp/yelp-ruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/Yelp/yelp-ruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/Yelp/yelp-ruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/Yelp/yelp-ruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/Yelp/yelp-ruby/contents/{+path}","compare_url":"https://api.github.com/repos/Yelp/yelp-ruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Yelp/yelp-ruby/merges","archive_url":"https://api.github.com/repos/Yelp/yelp-ruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Yelp/yelp-ruby/downloads","issues_url":"https://api.github.com/repos/Yelp/yelp-ruby/issues{/number}","pulls_url":"https://api.github.com/repos/Yelp/yelp-ruby/pulls{/number}","milestones_url":"https://api.github.com/repos/Yelp/yelp-ruby/milestones{/number}","notifications_url":"https://api.github.com/repos/Yelp/yelp-ruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Yelp/yelp-ruby/labels{/name}","releases_url":"https://api.github.com/repos/Yelp/yelp-ruby/releases{/id}","created_at":"2014-04-17T17:17:23Z","updated_at":"2015-11-05T22:07:52Z","pushed_at":"2015-11-19T19:33:12Z","git_url":"git://github.com/Yelp/yelp-ruby.git","ssh_url":"git@github.com:Yelp/yelp-ruby.git","clone_url":"https://github.com/Yelp/yelp-ruby.git","svn_url":"https://github.com/Yelp/yelp-ruby","homepage":null,"size":344,"stargazers_count":53,"watchers_count":53,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":36,"mirror_url":null,"open_issues_count":3,"forks":36,"open_issues":3,"watchers":53,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/Yelp/yelp-ruby/pulls/41"},"html":{"href":"https://github.com/Yelp/yelp-ruby/pull/41"},"issue":{"href":"https://api.github.com/repos/Yelp/yelp-ruby/issues/41"},"comments":{"href":"https://api.github.com/repos/Yelp/yelp-ruby/issues/41/comments"},"review_comments":{"href":"https://api.github.com/repos/Yelp/yelp-ruby/pulls/41/comments"},"review_comment":{"href":"https://api.github.com/repos/Yelp/yelp-ruby/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Yelp/yelp-ruby/pulls/41/commits"},"statuses":{"href":"https://api.github.com/repos/Yelp/yelp-ruby/statuses/c6f47c33a85693f5d757e6658f899feb6c8430fa"}}}}