{"action":"created","comment":{"url":"https://api.github.com/repos/dryrb/dry-validation/pulls/comments/49171586","id":49171586,"diff_hunk":"@@ -0,0 +1,21 @@\n+module Dry\n+  module Validation\n+    class Rule::Attr < Rule\n+      def self.new(name, predicate)\n+        super(name, predicate.curry(name))\n+      end\n+\n+      def type\n+        :attr\n+      end\n+\n+      def evaluate_input(input)\n+        input.public_send(name)\n+      end\n+\n+      def call(input)\n+        Validation::Rule::Result::EvaluatedValue.new(input, predicate.(input), self)","path":"lib/dry/validation/rule/attr.rb","position":17,"original_position":17,"commit_id":"45b711fc4bd46bd641ac5711eea0746106140244","original_commit_id":"45b711fc4bd46bd641ac5711eea0746106140244","user":{"login":"solnic","id":1066,"avatar_url":"https://avatars.githubusercontent.com/u/1066?v=3","gravatar_id":"","url":"https://api.github.com/users/solnic","html_url":"https://github.com/solnic","followers_url":"https://api.github.com/users/solnic/followers","following_url":"https://api.github.com/users/solnic/following{/other_user}","gists_url":"https://api.github.com/users/solnic/gists{/gist_id}","starred_url":"https://api.github.com/users/solnic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solnic/subscriptions","organizations_url":"https://api.github.com/users/solnic/orgs","repos_url":"https://api.github.com/users/solnic/repos","events_url":"https://api.github.com/users/solnic/events{/privacy}","received_events_url":"https://api.github.com/users/solnic/received_events","type":"User","site_admin":false},"body":"How would that work? I remember we discussed this but now I can't find it for some reason :(","created_at":"2016-01-08T09:41:12Z","updated_at":"2016-01-08T09:41:12Z","html_url":"https://github.com/dryrb/dry-validation/pull/29#discussion_r49171586","pull_request_url":"https://api.github.com/repos/dryrb/dry-validation/pulls/29","_links":{"self":{"href":"https://api.github.com/repos/dryrb/dry-validation/pulls/comments/49171586"},"html":{"href":"https://github.com/dryrb/dry-validation/pull/29#discussion_r49171586"},"pull_request":{"href":"https://api.github.com/repos/dryrb/dry-validation/pulls/29"}}},"pull_request":{"url":"https://api.github.com/repos/dryrb/dry-validation/pulls/29","id":52962623,"html_url":"https://github.com/dryrb/dry-validation/pull/29","diff_url":"https://github.com/dryrb/dry-validation/pull/29.diff","patch_url":"https://github.com/dryrb/dry-validation/pull/29.patch","issue_url":"https://api.github.com/repos/dryrb/dry-validation/issues/29","number":29,"state":"open","locked":false,"title":"[WIP] Add support for reading attribute values","user":{"login":"SunnyMagadan","id":2077690,"avatar_url":"https://avatars.githubusercontent.com/u/2077690?v=3","gravatar_id":"","url":"https://api.github.com/users/SunnyMagadan","html_url":"https://github.com/SunnyMagadan","followers_url":"https://api.github.com/users/SunnyMagadan/followers","following_url":"https://api.github.com/users/SunnyMagadan/following{/other_user}","gists_url":"https://api.github.com/users/SunnyMagadan/gists{/gist_id}","starred_url":"https://api.github.com/users/SunnyMagadan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SunnyMagadan/subscriptions","organizations_url":"https://api.github.com/users/SunnyMagadan/orgs","repos_url":"https://api.github.com/users/SunnyMagadan/repos","events_url":"https://api.github.com/users/SunnyMagadan/events{/privacy}","received_events_url":"https://api.github.com/users/SunnyMagadan/received_events","type":"User","site_admin":false},"body":"Added rule attr and attr? predicate\r\n\r\nhttps://github.com/dryrb/dry-validation/issues/5","created_at":"2015-12-08T10:27:54Z","updated_at":"2016-01-08T09:41:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8dcc43e3678e4ab161ad22e81cc41edc3dfbb06a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dryrb/dry-validation/pulls/29/commits","review_comments_url":"https://api.github.com/repos/dryrb/dry-validation/pulls/29/comments","review_comment_url":"https://api.github.com/repos/dryrb/dry-validation/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dryrb/dry-validation/issues/29/comments","statuses_url":"https://api.github.com/repos/dryrb/dry-validation/statuses/45b711fc4bd46bd641ac5711eea0746106140244","head":{"label":"SunnyMagadan:add-support-for-reading-attribute-values","ref":"add-support-for-reading-attribute-values","sha":"45b711fc4bd46bd641ac5711eea0746106140244","user":{"login":"SunnyMagadan","id":2077690,"avatar_url":"https://avatars.githubusercontent.com/u/2077690?v=3","gravatar_id":"","url":"https://api.github.com/users/SunnyMagadan","html_url":"https://github.com/SunnyMagadan","followers_url":"https://api.github.com/users/SunnyMagadan/followers","following_url":"https://api.github.com/users/SunnyMagadan/following{/other_user}","gists_url":"https://api.github.com/users/SunnyMagadan/gists{/gist_id}","starred_url":"https://api.github.com/users/SunnyMagadan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SunnyMagadan/subscriptions","organizations_url":"https://api.github.com/users/SunnyMagadan/orgs","repos_url":"https://api.github.com/users/SunnyMagadan/repos","events_url":"https://api.github.com/users/SunnyMagadan/events{/privacy}","received_events_url":"https://api.github.com/users/SunnyMagadan/received_events","type":"User","site_admin":false},"repo":{"id":47537039,"name":"dry-validation","full_name":"SunnyMagadan/dry-validation","owner":{"login":"SunnyMagadan","id":2077690,"avatar_url":"https://avatars.githubusercontent.com/u/2077690?v=3","gravatar_id":"","url":"https://api.github.com/users/SunnyMagadan","html_url":"https://github.com/SunnyMagadan","followers_url":"https://api.github.com/users/SunnyMagadan/followers","following_url":"https://api.github.com/users/SunnyMagadan/following{/other_user}","gists_url":"https://api.github.com/users/SunnyMagadan/gists{/gist_id}","starred_url":"https://api.github.com/users/SunnyMagadan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SunnyMagadan/subscriptions","organizations_url":"https://api.github.com/users/SunnyMagadan/orgs","repos_url":"https://api.github.com/users/SunnyMagadan/repos","events_url":"https://api.github.com/users/SunnyMagadan/events{/privacy}","received_events_url":"https://api.github.com/users/SunnyMagadan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/SunnyMagadan/dry-validation","description":"Data validation library based on predicate logic and rule composition","fork":true,"url":"https://api.github.com/repos/SunnyMagadan/dry-validation","forks_url":"https://api.github.com/repos/SunnyMagadan/dry-validation/forks","keys_url":"https://api.github.com/repos/SunnyMagadan/dry-validation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SunnyMagadan/dry-validation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SunnyMagadan/dry-validation/teams","hooks_url":"https://api.github.com/repos/SunnyMagadan/dry-validation/hooks","issue_events_url":"https://api.github.com/repos/SunnyMagadan/dry-validation/issues/events{/number}","events_url":"https://api.github.com/repos/SunnyMagadan/dry-validation/events","assignees_url":"https://api.github.com/repos/SunnyMagadan/dry-validation/assignees{/user}","branches_url":"https://api.github.com/repos/SunnyMagadan/dry-validation/branches{/branch}","tags_url":"https://api.github.com/repos/SunnyMagadan/dry-validation/tags","blobs_url":"https://api.github.com/repos/SunnyMagadan/dry-validation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SunnyMagadan/dry-validation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SunnyMagadan/dry-validation/git/refs{/sha}","trees_url":"https://api.github.com/repos/SunnyMagadan/dry-validation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SunnyMagadan/dry-validation/statuses/{sha}","languages_url":"https://api.github.com/repos/SunnyMagadan/dry-validation/languages","stargazers_url":"https://api.github.com/repos/SunnyMagadan/dry-validation/stargazers","contributors_url":"https://api.github.com/repos/SunnyMagadan/dry-validation/contributors","subscribers_url":"https://api.github.com/repos/SunnyMagadan/dry-validation/subscribers","subscription_url":"https://api.github.com/repos/SunnyMagadan/dry-validation/subscription","commits_url":"https://api.github.com/repos/SunnyMagadan/dry-validation/commits{/sha}","git_commits_url":"https://api.github.com/repos/SunnyMagadan/dry-validation/git/commits{/sha}","comments_url":"https://api.github.com/repos/SunnyMagadan/dry-validation/comments{/number}","issue_comment_url":"https://api.github.com/repos/SunnyMagadan/dry-validation/issues/comments{/number}","contents_url":"https://api.github.com/repos/SunnyMagadan/dry-validation/contents/{+path}","compare_url":"https://api.github.com/repos/SunnyMagadan/dry-validation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SunnyMagadan/dry-validation/merges","archive_url":"https://api.github.com/repos/SunnyMagadan/dry-validation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SunnyMagadan/dry-validation/downloads","issues_url":"https://api.github.com/repos/SunnyMagadan/dry-validation/issues{/number}","pulls_url":"https://api.github.com/repos/SunnyMagadan/dry-validation/pulls{/number}","milestones_url":"https://api.github.com/repos/SunnyMagadan/dry-validation/milestones{/number}","notifications_url":"https://api.github.com/repos/SunnyMagadan/dry-validation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SunnyMagadan/dry-validation/labels{/name}","releases_url":"https://api.github.com/repos/SunnyMagadan/dry-validation/releases{/id}","created_at":"2015-12-07T07:42:10Z","updated_at":"2015-12-07T07:42:10Z","pushed_at":"2016-01-07T08:58:31Z","git_url":"git://github.com/SunnyMagadan/dry-validation.git","ssh_url":"git@github.com:SunnyMagadan/dry-validation.git","clone_url":"https://github.com/SunnyMagadan/dry-validation.git","svn_url":"https://github.com/SunnyMagadan/dry-validation","homepage":"http://dryrb.github.io/dry-validation/","size":280,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dryrb:master","ref":"master","sha":"5baf6278e70ceeb10fdc35b3e231a700da07c846","user":{"login":"dryrb","id":11280820,"avatar_url":"https://avatars.githubusercontent.com/u/11280820?v=3","gravatar_id":"","url":"https://api.github.com/users/dryrb","html_url":"https://github.com/dryrb","followers_url":"https://api.github.com/users/dryrb/followers","following_url":"https://api.github.com/users/dryrb/following{/other_user}","gists_url":"https://api.github.com/users/dryrb/gists{/gist_id}","starred_url":"https://api.github.com/users/dryrb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dryrb/subscriptions","organizations_url":"https://api.github.com/users/dryrb/orgs","repos_url":"https://api.github.com/users/dryrb/repos","events_url":"https://api.github.com/users/dryrb/events{/privacy}","received_events_url":"https://api.github.com/users/dryrb/received_events","type":"Organization","site_admin":false},"repo":{"id":39532631,"name":"dry-validation","full_name":"dryrb/dry-validation","owner":{"login":"dryrb","id":11280820,"avatar_url":"https://avatars.githubusercontent.com/u/11280820?v=3","gravatar_id":"","url":"https://api.github.com/users/dryrb","html_url":"https://github.com/dryrb","followers_url":"https://api.github.com/users/dryrb/followers","following_url":"https://api.github.com/users/dryrb/following{/other_user}","gists_url":"https://api.github.com/users/dryrb/gists{/gist_id}","starred_url":"https://api.github.com/users/dryrb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dryrb/subscriptions","organizations_url":"https://api.github.com/users/dryrb/orgs","repos_url":"https://api.github.com/users/dryrb/repos","events_url":"https://api.github.com/users/dryrb/events{/privacy}","received_events_url":"https://api.github.com/users/dryrb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dryrb/dry-validation","description":"Data validation library based on predicate logic and rule composition","fork":false,"url":"https://api.github.com/repos/dryrb/dry-validation","forks_url":"https://api.github.com/repos/dryrb/dry-validation/forks","keys_url":"https://api.github.com/repos/dryrb/dry-validation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dryrb/dry-validation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dryrb/dry-validation/teams","hooks_url":"https://api.github.com/repos/dryrb/dry-validation/hooks","issue_events_url":"https://api.github.com/repos/dryrb/dry-validation/issues/events{/number}","events_url":"https://api.github.com/repos/dryrb/dry-validation/events","assignees_url":"https://api.github.com/repos/dryrb/dry-validation/assignees{/user}","branches_url":"https://api.github.com/repos/dryrb/dry-validation/branches{/branch}","tags_url":"https://api.github.com/repos/dryrb/dry-validation/tags","blobs_url":"https://api.github.com/repos/dryrb/dry-validation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dryrb/dry-validation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dryrb/dry-validation/git/refs{/sha}","trees_url":"https://api.github.com/repos/dryrb/dry-validation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dryrb/dry-validation/statuses/{sha}","languages_url":"https://api.github.com/repos/dryrb/dry-validation/languages","stargazers_url":"https://api.github.com/repos/dryrb/dry-validation/stargazers","contributors_url":"https://api.github.com/repos/dryrb/dry-validation/contributors","subscribers_url":"https://api.github.com/repos/dryrb/dry-validation/subscribers","subscription_url":"https://api.github.com/repos/dryrb/dry-validation/subscription","commits_url":"https://api.github.com/repos/dryrb/dry-validation/commits{/sha}","git_commits_url":"https://api.github.com/repos/dryrb/dry-validation/git/commits{/sha}","comments_url":"https://api.github.com/repos/dryrb/dry-validation/comments{/number}","issue_comment_url":"https://api.github.com/repos/dryrb/dry-validation/issues/comments{/number}","contents_url":"https://api.github.com/repos/dryrb/dry-validation/contents/{+path}","compare_url":"https://api.github.com/repos/dryrb/dry-validation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dryrb/dry-validation/merges","archive_url":"https://api.github.com/repos/dryrb/dry-validation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dryrb/dry-validation/downloads","issues_url":"https://api.github.com/repos/dryrb/dry-validation/issues{/number}","pulls_url":"https://api.github.com/repos/dryrb/dry-validation/pulls{/number}","milestones_url":"https://api.github.com/repos/dryrb/dry-validation/milestones{/number}","notifications_url":"https://api.github.com/repos/dryrb/dry-validation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dryrb/dry-validation/labels{/name}","releases_url":"https://api.github.com/repos/dryrb/dry-validation/releases{/id}","created_at":"2015-07-22T22:05:39Z","updated_at":"2016-01-08T09:20:24Z","pushed_at":"2016-01-06T21:28:49Z","git_url":"git://github.com/dryrb/dry-validation.git","ssh_url":"git@github.com:dryrb/dry-validation.git","clone_url":"https://github.com/dryrb/dry-validation.git","svn_url":"https://github.com/dryrb/dry-validation","homepage":"http://dryrb.github.io/dry-validation/","size":295,"stargazers_count":216,"watchers_count":216,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":9,"mirror_url":null,"open_issues_count":7,"forks":9,"open_issues":7,"watchers":216,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dryrb/dry-validation/pulls/29"},"html":{"href":"https://github.com/dryrb/dry-validation/pull/29"},"issue":{"href":"https://api.github.com/repos/dryrb/dry-validation/issues/29"},"comments":{"href":"https://api.github.com/repos/dryrb/dry-validation/issues/29/comments"},"review_comments":{"href":"https://api.github.com/repos/dryrb/dry-validation/pulls/29/comments"},"review_comment":{"href":"https://api.github.com/repos/dryrb/dry-validation/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dryrb/dry-validation/pulls/29/commits"},"statuses":{"href":"https://api.github.com/repos/dryrb/dry-validation/statuses/45b711fc4bd46bd641ac5711eea0746106140244"}}}}