{"action":"created","comment":{"url":"https://api.github.com/repos/payout/rester/pulls/comments/44093591","id":44093591,"diff_hunk":"@@ -22,17 +24,34 @@ def strict?\n         !!options[:strict]\n       end\n \n+      def frozen?\n+        !!@_frozen\n+      end\n+\n       def freeze\n         @_validators.freeze\n         @_required_fields.freeze\n         @_defaults.freeze\n         @_all_fields.freeze\n+        @_frozen = true","path":"lib/rester/service/resource/params.rb","position":36,"original_position":36,"commit_id":"a599e0069c5380c4d404b81100edb72dca389b57","original_commit_id":"a599e0069c5380c4d404b81100edb72dca389b57","user":{"login":"roberthoner","id":4632927,"avatar_url":"https://avatars.githubusercontent.com/u/4632927?v=3","gravatar_id":"","url":"https://api.github.com/users/roberthoner","html_url":"https://github.com/roberthoner","followers_url":"https://api.github.com/users/roberthoner/followers","following_url":"https://api.github.com/users/roberthoner/following{/other_user}","gists_url":"https://api.github.com/users/roberthoner/gists{/gist_id}","starred_url":"https://api.github.com/users/roberthoner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roberthoner/subscriptions","organizations_url":"https://api.github.com/users/roberthoner/orgs","repos_url":"https://api.github.com/users/roberthoner/repos","events_url":"https://api.github.com/users/roberthoner/events{/privacy}","received_events_url":"https://api.github.com/users/roberthoner/received_events","type":"User","site_admin":false},"body":"I'm realizing there's a better way to do this since freeze is built in.\r\n\r\nI was thinking, what's to stop someone from overwriting the `@_frozen` instance variable?\r\n\r\nFreezing is built in, so instead of doing `@_frozen` do:\r\n\r\n```ruby\r\ndef freeze\r\n  @_validators.freeze\r\n  @_required_fields.freeze\r\n  @_defaults.freeze\r\n  @_all_fields.freeze\r\n  super\r\nend\r\n```\r\n\r\nThe `frozen?` method is already built in and calling `super` will prevent any of the instance variables from being modified: \r\n```ruby\r\nobj.instance_variable_set(:@_all_fields, 'something else!')\r\n```\r\n\r\nCalling `freeze` on `@_all_fields` prevents that object from being modified, but it doesn't prevent the instance variable itself from being overwritten.","created_at":"2015-11-06T01:18:01Z","updated_at":"2015-11-06T01:18:01Z","html_url":"https://github.com/payout/rester/pull/36#discussion_r44093591","pull_request_url":"https://api.github.com/repos/payout/rester/pulls/36","_links":{"self":{"href":"https://api.github.com/repos/payout/rester/pulls/comments/44093591"},"html":{"href":"https://github.com/payout/rester/pull/36#discussion_r44093591"},"pull_request":{"href":"https://api.github.com/repos/payout/rester/pulls/36"}}},"pull_request":{"url":"https://api.github.com/repos/payout/rester/pulls/36","id":49903622,"html_url":"https://github.com/payout/rester/pull/36","diff_url":"https://github.com/payout/rester/pull/36.diff","patch_url":"https://github.com/payout/rester/pull/36.patch","issue_url":"https://api.github.com/repos/payout/rester/issues/36","number":36,"state":"open","locked":false,"title":"Allowing unique params per method","user":{"login":"roberthoner","id":4632927,"avatar_url":"https://avatars.githubusercontent.com/u/4632927?v=3","gravatar_id":"","url":"https://api.github.com/users/roberthoner","html_url":"https://github.com/roberthoner","followers_url":"https://api.github.com/users/roberthoner/followers","following_url":"https://api.github.com/users/roberthoner/following{/other_user}","gists_url":"https://api.github.com/users/roberthoner/gists{/gist_id}","starred_url":"https://api.github.com/users/roberthoner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roberthoner/subscriptions","organizations_url":"https://api.github.com/users/roberthoner/orgs","repos_url":"https://api.github.com/users/roberthoner/repos","events_url":"https://api.github.com/users/roberthoner/events{/privacy}","received_events_url":"https://api.github.com/users/roberthoner/received_events","type":"User","site_admin":false},"body":"#15 ","created_at":"2015-11-06T00:59:05Z","updated_at":"2015-11-06T01:18:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c1a3e511496a6351bd2362781f1e585fa708c8be","assignee":{"login":"roberthoner","id":4632927,"avatar_url":"https://avatars.githubusercontent.com/u/4632927?v=3","gravatar_id":"","url":"https://api.github.com/users/roberthoner","html_url":"https://github.com/roberthoner","followers_url":"https://api.github.com/users/roberthoner/followers","following_url":"https://api.github.com/users/roberthoner/following{/other_user}","gists_url":"https://api.github.com/users/roberthoner/gists{/gist_id}","starred_url":"https://api.github.com/users/roberthoner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roberthoner/subscriptions","organizations_url":"https://api.github.com/users/roberthoner/orgs","repos_url":"https://api.github.com/users/roberthoner/repos","events_url":"https://api.github.com/users/roberthoner/events{/privacy}","received_events_url":"https://api.github.com/users/roberthoner/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/payout/rester/milestones/4","html_url":"https://github.com/payout/rester/milestones/0.3.0","labels_url":"https://api.github.com/repos/payout/rester/milestones/4/labels","id":1359945,"number":4,"title":"0.3.0","description":"","creator":{"login":"roberthoner","id":4632927,"avatar_url":"https://avatars.githubusercontent.com/u/4632927?v=3","gravatar_id":"","url":"https://api.github.com/users/roberthoner","html_url":"https://github.com/roberthoner","followers_url":"https://api.github.com/users/roberthoner/followers","following_url":"https://api.github.com/users/roberthoner/following{/other_user}","gists_url":"https://api.github.com/users/roberthoner/gists{/gist_id}","starred_url":"https://api.github.com/users/roberthoner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roberthoner/subscriptions","organizations_url":"https://api.github.com/users/roberthoner/orgs","repos_url":"https://api.github.com/users/roberthoner/repos","events_url":"https://api.github.com/users/roberthoner/events{/privacy}","received_events_url":"https://api.github.com/users/roberthoner/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":13,"state":"open","created_at":"2015-10-16T17:51:20Z","updated_at":"2015-11-06T00:59:05Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/payout/rester/pulls/36/commits","review_comments_url":"https://api.github.com/repos/payout/rester/pulls/36/comments","review_comment_url":"https://api.github.com/repos/payout/rester/pulls/comments{/number}","comments_url":"https://api.github.com/repos/payout/rester/issues/36/comments","statuses_url":"https://api.github.com/repos/payout/rester/statuses/a599e0069c5380c4d404b81100edb72dca389b57","head":{"label":"payout:issue/15","ref":"issue/15","sha":"a599e0069c5380c4d404b81100edb72dca389b57","user":{"login":"payout","id":1719238,"avatar_url":"https://avatars.githubusercontent.com/u/1719238?v=3","gravatar_id":"","url":"https://api.github.com/users/payout","html_url":"https://github.com/payout","followers_url":"https://api.github.com/users/payout/followers","following_url":"https://api.github.com/users/payout/following{/other_user}","gists_url":"https://api.github.com/users/payout/gists{/gist_id}","starred_url":"https://api.github.com/users/payout/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/payout/subscriptions","organizations_url":"https://api.github.com/users/payout/orgs","repos_url":"https://api.github.com/users/payout/repos","events_url":"https://api.github.com/users/payout/events{/privacy}","received_events_url":"https://api.github.com/users/payout/received_events","type":"Organization","site_admin":false},"repo":{"id":43285081,"name":"rester","full_name":"payout/rester","owner":{"login":"payout","id":1719238,"avatar_url":"https://avatars.githubusercontent.com/u/1719238?v=3","gravatar_id":"","url":"https://api.github.com/users/payout","html_url":"https://github.com/payout","followers_url":"https://api.github.com/users/payout/followers","following_url":"https://api.github.com/users/payout/following{/other_user}","gists_url":"https://api.github.com/users/payout/gists{/gist_id}","starred_url":"https://api.github.com/users/payout/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/payout/subscriptions","organizations_url":"https://api.github.com/users/payout/orgs","repos_url":"https://api.github.com/users/payout/repos","events_url":"https://api.github.com/users/payout/events{/privacy}","received_events_url":"https://api.github.com/users/payout/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/payout/rester","description":"An exceedingly quick way of creating restful interfaces between Ruby services.","fork":false,"url":"https://api.github.com/repos/payout/rester","forks_url":"https://api.github.com/repos/payout/rester/forks","keys_url":"https://api.github.com/repos/payout/rester/keys{/key_id}","collaborators_url":"https://api.github.com/repos/payout/rester/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/payout/rester/teams","hooks_url":"https://api.github.com/repos/payout/rester/hooks","issue_events_url":"https://api.github.com/repos/payout/rester/issues/events{/number}","events_url":"https://api.github.com/repos/payout/rester/events","assignees_url":"https://api.github.com/repos/payout/rester/assignees{/user}","branches_url":"https://api.github.com/repos/payout/rester/branches{/branch}","tags_url":"https://api.github.com/repos/payout/rester/tags","blobs_url":"https://api.github.com/repos/payout/rester/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/payout/rester/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/payout/rester/git/refs{/sha}","trees_url":"https://api.github.com/repos/payout/rester/git/trees{/sha}","statuses_url":"https://api.github.com/repos/payout/rester/statuses/{sha}","languages_url":"https://api.github.com/repos/payout/rester/languages","stargazers_url":"https://api.github.com/repos/payout/rester/stargazers","contributors_url":"https://api.github.com/repos/payout/rester/contributors","subscribers_url":"https://api.github.com/repos/payout/rester/subscribers","subscription_url":"https://api.github.com/repos/payout/rester/subscription","commits_url":"https://api.github.com/repos/payout/rester/commits{/sha}","git_commits_url":"https://api.github.com/repos/payout/rester/git/commits{/sha}","comments_url":"https://api.github.com/repos/payout/rester/comments{/number}","issue_comment_url":"https://api.github.com/repos/payout/rester/issues/comments{/number}","contents_url":"https://api.github.com/repos/payout/rester/contents/{+path}","compare_url":"https://api.github.com/repos/payout/rester/compare/{base}...{head}","merges_url":"https://api.github.com/repos/payout/rester/merges","archive_url":"https://api.github.com/repos/payout/rester/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/payout/rester/downloads","issues_url":"https://api.github.com/repos/payout/rester/issues{/number}","pulls_url":"https://api.github.com/repos/payout/rester/pulls{/number}","milestones_url":"https://api.github.com/repos/payout/rester/milestones{/number}","notifications_url":"https://api.github.com/repos/payout/rester/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/payout/rester/labels{/name}","releases_url":"https://api.github.com/repos/payout/rester/releases{/id}","created_at":"2015-09-28T06:59:28Z","updated_at":"2015-10-06T00:30:20Z","pushed_at":"2015-11-06T00:59:05Z","git_url":"git://github.com/payout/rester.git","ssh_url":"git@github.com:payout/rester.git","clone_url":"https://github.com/payout/rester.git","svn_url":"https://github.com/payout/rester","homepage":"","size":493,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":10,"forks":0,"open_issues":10,"watchers":1,"default_branch":"master"}},"base":{"label":"payout:master","ref":"master","sha":"78003b9dc10eb5a76f77c57278185aac9b272fdd","user":{"login":"payout","id":1719238,"avatar_url":"https://avatars.githubusercontent.com/u/1719238?v=3","gravatar_id":"","url":"https://api.github.com/users/payout","html_url":"https://github.com/payout","followers_url":"https://api.github.com/users/payout/followers","following_url":"https://api.github.com/users/payout/following{/other_user}","gists_url":"https://api.github.com/users/payout/gists{/gist_id}","starred_url":"https://api.github.com/users/payout/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/payout/subscriptions","organizations_url":"https://api.github.com/users/payout/orgs","repos_url":"https://api.github.com/users/payout/repos","events_url":"https://api.github.com/users/payout/events{/privacy}","received_events_url":"https://api.github.com/users/payout/received_events","type":"Organization","site_admin":false},"repo":{"id":43285081,"name":"rester","full_name":"payout/rester","owner":{"login":"payout","id":1719238,"avatar_url":"https://avatars.githubusercontent.com/u/1719238?v=3","gravatar_id":"","url":"https://api.github.com/users/payout","html_url":"https://github.com/payout","followers_url":"https://api.github.com/users/payout/followers","following_url":"https://api.github.com/users/payout/following{/other_user}","gists_url":"https://api.github.com/users/payout/gists{/gist_id}","starred_url":"https://api.github.com/users/payout/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/payout/subscriptions","organizations_url":"https://api.github.com/users/payout/orgs","repos_url":"https://api.github.com/users/payout/repos","events_url":"https://api.github.com/users/payout/events{/privacy}","received_events_url":"https://api.github.com/users/payout/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/payout/rester","description":"An exceedingly quick way of creating restful interfaces between Ruby services.","fork":false,"url":"https://api.github.com/repos/payout/rester","forks_url":"https://api.github.com/repos/payout/rester/forks","keys_url":"https://api.github.com/repos/payout/rester/keys{/key_id}","collaborators_url":"https://api.github.com/repos/payout/rester/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/payout/rester/teams","hooks_url":"https://api.github.com/repos/payout/rester/hooks","issue_events_url":"https://api.github.com/repos/payout/rester/issues/events{/number}","events_url":"https://api.github.com/repos/payout/rester/events","assignees_url":"https://api.github.com/repos/payout/rester/assignees{/user}","branches_url":"https://api.github.com/repos/payout/rester/branches{/branch}","tags_url":"https://api.github.com/repos/payout/rester/tags","blobs_url":"https://api.github.com/repos/payout/rester/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/payout/rester/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/payout/rester/git/refs{/sha}","trees_url":"https://api.github.com/repos/payout/rester/git/trees{/sha}","statuses_url":"https://api.github.com/repos/payout/rester/statuses/{sha}","languages_url":"https://api.github.com/repos/payout/rester/languages","stargazers_url":"https://api.github.com/repos/payout/rester/stargazers","contributors_url":"https://api.github.com/repos/payout/rester/contributors","subscribers_url":"https://api.github.com/repos/payout/rester/subscribers","subscription_url":"https://api.github.com/repos/payout/rester/subscription","commits_url":"https://api.github.com/repos/payout/rester/commits{/sha}","git_commits_url":"https://api.github.com/repos/payout/rester/git/commits{/sha}","comments_url":"https://api.github.com/repos/payout/rester/comments{/number}","issue_comment_url":"https://api.github.com/repos/payout/rester/issues/comments{/number}","contents_url":"https://api.github.com/repos/payout/rester/contents/{+path}","compare_url":"https://api.github.com/repos/payout/rester/compare/{base}...{head}","merges_url":"https://api.github.com/repos/payout/rester/merges","archive_url":"https://api.github.com/repos/payout/rester/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/payout/rester/downloads","issues_url":"https://api.github.com/repos/payout/rester/issues{/number}","pulls_url":"https://api.github.com/repos/payout/rester/pulls{/number}","milestones_url":"https://api.github.com/repos/payout/rester/milestones{/number}","notifications_url":"https://api.github.com/repos/payout/rester/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/payout/rester/labels{/name}","releases_url":"https://api.github.com/repos/payout/rester/releases{/id}","created_at":"2015-09-28T06:59:28Z","updated_at":"2015-10-06T00:30:20Z","pushed_at":"2015-11-06T00:59:05Z","git_url":"git://github.com/payout/rester.git","ssh_url":"git@github.com:payout/rester.git","clone_url":"https://github.com/payout/rester.git","svn_url":"https://github.com/payout/rester","homepage":"","size":493,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":10,"forks":0,"open_issues":10,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/payout/rester/pulls/36"},"html":{"href":"https://github.com/payout/rester/pull/36"},"issue":{"href":"https://api.github.com/repos/payout/rester/issues/36"},"comments":{"href":"https://api.github.com/repos/payout/rester/issues/36/comments"},"review_comments":{"href":"https://api.github.com/repos/payout/rester/pulls/36/comments"},"review_comment":{"href":"https://api.github.com/repos/payout/rester/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/payout/rester/pulls/36/commits"},"statuses":{"href":"https://api.github.com/repos/payout/rester/statuses/a599e0069c5380c4d404b81100edb72dca389b57"}}}}