{"action":"opened","number":21,"pull_request":{"url":"https://api.github.com/repos/yuya-takeyama/flagship/pulls/21","id":99220835,"html_url":"https://github.com/yuya-takeyama/flagship/pull/21","diff_url":"https://github.com/yuya-takeyama/flagship/pull/21.diff","patch_url":"https://github.com/yuya-takeyama/flagship/pull/21.patch","issue_url":"https://api.github.com/repos/yuya-takeyama/flagship/issues/21","number":21,"state":"open","locked":false,"title":"Helpers","user":{"login":"sethjeffery","id":1628558,"avatar_url":"https://avatars.githubusercontent.com/u/1628558?v=3","gravatar_id":"","url":"https://api.github.com/users/sethjeffery","html_url":"https://github.com/sethjeffery","followers_url":"https://api.github.com/users/sethjeffery/followers","following_url":"https://api.github.com/users/sethjeffery/following{/other_user}","gists_url":"https://api.github.com/users/sethjeffery/gists{/gist_id}","starred_url":"https://api.github.com/users/sethjeffery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sethjeffery/subscriptions","organizations_url":"https://api.github.com/users/sethjeffery/orgs","repos_url":"https://api.github.com/users/sethjeffery/repos","events_url":"https://api.github.com/users/sethjeffery/events{/privacy}","received_events_url":"https://api.github.com/users/sethjeffery/received_events","type":"User","site_admin":false},"body":"From the README...\r\n\r\n\r\n## Helper methods\r\n\r\nYou can define helpers with the `helper` keyword. Helpers can be used within blocks, procs, or as symbolic names for if statements to tidy up your code.\r\n\r\n```rb\r\nFlagship.define :blog do\r\n  helper :is_author do |comment, user|\r\n    comment.author == user\r\n  end\r\n\r\n  def can_view_comment(context)\r\n    context.current_user.moderator?\r\n  end\r\n\r\n  enable :comment, if: :can_view_comment\r\n  enable :comment_deletion, if: ->(context) { is_author(context.comment, context.current_user) }\r\nend\r\n```\r\n\r\nTo share helpers, you can simply include them as modules.\r\n\r\n\r\n```rb\r\nmodule FlagHelpers\r\n  def is_author(context)\r\n    context.comment.author == context.current_user\r\n  end\r\nend\r\n\r\nFlagship.define :development do\r\n  include FlagHelpers\r\n  enable :delete, if: :is_author\r\nend\r\n\r\nFlagship.define :production do\r\n  include FlagHelpers\r\n  enable :delete, if: :is_author\r\nend\r\n```\r\n","created_at":"2016-12-23T09:44:16Z","updated_at":"2016-12-23T09:44:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/yuya-takeyama/flagship/pulls/21/commits","review_comments_url":"https://api.github.com/repos/yuya-takeyama/flagship/pulls/21/comments","review_comment_url":"https://api.github.com/repos/yuya-takeyama/flagship/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yuya-takeyama/flagship/issues/21/comments","statuses_url":"https://api.github.com/repos/yuya-takeyama/flagship/statuses/0218f31322c53f89e63fdef3e79ee2b16e3fae30","head":{"label":"sethjeffery:helpers","ref":"helpers","sha":"0218f31322c53f89e63fdef3e79ee2b16e3fae30","user":{"login":"sethjeffery","id":1628558,"avatar_url":"https://avatars.githubusercontent.com/u/1628558?v=3","gravatar_id":"","url":"https://api.github.com/users/sethjeffery","html_url":"https://github.com/sethjeffery","followers_url":"https://api.github.com/users/sethjeffery/followers","following_url":"https://api.github.com/users/sethjeffery/following{/other_user}","gists_url":"https://api.github.com/users/sethjeffery/gists{/gist_id}","starred_url":"https://api.github.com/users/sethjeffery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sethjeffery/subscriptions","organizations_url":"https://api.github.com/users/sethjeffery/orgs","repos_url":"https://api.github.com/users/sethjeffery/repos","events_url":"https://api.github.com/users/sethjeffery/events{/privacy}","received_events_url":"https://api.github.com/users/sethjeffery/received_events","type":"User","site_admin":false},"repo":{"id":77136306,"name":"flagship","full_name":"sethjeffery/flagship","owner":{"login":"sethjeffery","id":1628558,"avatar_url":"https://avatars.githubusercontent.com/u/1628558?v=3","gravatar_id":"","url":"https://api.github.com/users/sethjeffery","html_url":"https://github.com/sethjeffery","followers_url":"https://api.github.com/users/sethjeffery/followers","following_url":"https://api.github.com/users/sethjeffery/following{/other_user}","gists_url":"https://api.github.com/users/sethjeffery/gists{/gist_id}","starred_url":"https://api.github.com/users/sethjeffery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sethjeffery/subscriptions","organizations_url":"https://api.github.com/users/sethjeffery/orgs","repos_url":"https://api.github.com/users/sethjeffery/repos","events_url":"https://api.github.com/users/sethjeffery/events{/privacy}","received_events_url":"https://api.github.com/users/sethjeffery/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sethjeffery/flagship","description":":flags: Ship/unship features using flags defined with declarative DSL :ship:","fork":true,"url":"https://api.github.com/repos/sethjeffery/flagship","forks_url":"https://api.github.com/repos/sethjeffery/flagship/forks","keys_url":"https://api.github.com/repos/sethjeffery/flagship/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sethjeffery/flagship/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sethjeffery/flagship/teams","hooks_url":"https://api.github.com/repos/sethjeffery/flagship/hooks","issue_events_url":"https://api.github.com/repos/sethjeffery/flagship/issues/events{/number}","events_url":"https://api.github.com/repos/sethjeffery/flagship/events","assignees_url":"https://api.github.com/repos/sethjeffery/flagship/assignees{/user}","branches_url":"https://api.github.com/repos/sethjeffery/flagship/branches{/branch}","tags_url":"https://api.github.com/repos/sethjeffery/flagship/tags","blobs_url":"https://api.github.com/repos/sethjeffery/flagship/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sethjeffery/flagship/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sethjeffery/flagship/git/refs{/sha}","trees_url":"https://api.github.com/repos/sethjeffery/flagship/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sethjeffery/flagship/statuses/{sha}","languages_url":"https://api.github.com/repos/sethjeffery/flagship/languages","stargazers_url":"https://api.github.com/repos/sethjeffery/flagship/stargazers","contributors_url":"https://api.github.com/repos/sethjeffery/flagship/contributors","subscribers_url":"https://api.github.com/repos/sethjeffery/flagship/subscribers","subscription_url":"https://api.github.com/repos/sethjeffery/flagship/subscription","commits_url":"https://api.github.com/repos/sethjeffery/flagship/commits{/sha}","git_commits_url":"https://api.github.com/repos/sethjeffery/flagship/git/commits{/sha}","comments_url":"https://api.github.com/repos/sethjeffery/flagship/comments{/number}","issue_comment_url":"https://api.github.com/repos/sethjeffery/flagship/issues/comments{/number}","contents_url":"https://api.github.com/repos/sethjeffery/flagship/contents/{+path}","compare_url":"https://api.github.com/repos/sethjeffery/flagship/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sethjeffery/flagship/merges","archive_url":"https://api.github.com/repos/sethjeffery/flagship/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sethjeffery/flagship/downloads","issues_url":"https://api.github.com/repos/sethjeffery/flagship/issues{/number}","pulls_url":"https://api.github.com/repos/sethjeffery/flagship/pulls{/number}","milestones_url":"https://api.github.com/repos/sethjeffery/flagship/milestones{/number}","notifications_url":"https://api.github.com/repos/sethjeffery/flagship/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sethjeffery/flagship/labels{/name}","releases_url":"https://api.github.com/repos/sethjeffery/flagship/releases{/id}","deployments_url":"https://api.github.com/repos/sethjeffery/flagship/deployments","created_at":"2016-12-22T10:39:07Z","updated_at":"2016-12-22T10:39:10Z","pushed_at":"2016-12-23T09:42:21Z","git_url":"git://github.com/sethjeffery/flagship.git","ssh_url":"git@github.com:sethjeffery/flagship.git","clone_url":"https://github.com/sethjeffery/flagship.git","svn_url":"https://github.com/sethjeffery/flagship","homepage":"","size":43,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"yuya-takeyama:master","ref":"master","sha":"3abc92f0d43378d51db1efe7b64ceda228234485","user":{"login":"yuya-takeyama","id":241542,"avatar_url":"https://avatars.githubusercontent.com/u/241542?v=3","gravatar_id":"","url":"https://api.github.com/users/yuya-takeyama","html_url":"https://github.com/yuya-takeyama","followers_url":"https://api.github.com/users/yuya-takeyama/followers","following_url":"https://api.github.com/users/yuya-takeyama/following{/other_user}","gists_url":"https://api.github.com/users/yuya-takeyama/gists{/gist_id}","starred_url":"https://api.github.com/users/yuya-takeyama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuya-takeyama/subscriptions","organizations_url":"https://api.github.com/users/yuya-takeyama/orgs","repos_url":"https://api.github.com/users/yuya-takeyama/repos","events_url":"https://api.github.com/users/yuya-takeyama/events{/privacy}","received_events_url":"https://api.github.com/users/yuya-takeyama/received_events","type":"User","site_admin":false},"repo":{"id":72349843,"name":"flagship","full_name":"yuya-takeyama/flagship","owner":{"login":"yuya-takeyama","id":241542,"avatar_url":"https://avatars.githubusercontent.com/u/241542?v=3","gravatar_id":"","url":"https://api.github.com/users/yuya-takeyama","html_url":"https://github.com/yuya-takeyama","followers_url":"https://api.github.com/users/yuya-takeyama/followers","following_url":"https://api.github.com/users/yuya-takeyama/following{/other_user}","gists_url":"https://api.github.com/users/yuya-takeyama/gists{/gist_id}","starred_url":"https://api.github.com/users/yuya-takeyama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuya-takeyama/subscriptions","organizations_url":"https://api.github.com/users/yuya-takeyama/orgs","repos_url":"https://api.github.com/users/yuya-takeyama/repos","events_url":"https://api.github.com/users/yuya-takeyama/events{/privacy}","received_events_url":"https://api.github.com/users/yuya-takeyama/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yuya-takeyama/flagship","description":":flags: Ship/unship features using flags defined with declarative DSL :ship:","fork":false,"url":"https://api.github.com/repos/yuya-takeyama/flagship","forks_url":"https://api.github.com/repos/yuya-takeyama/flagship/forks","keys_url":"https://api.github.com/repos/yuya-takeyama/flagship/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yuya-takeyama/flagship/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yuya-takeyama/flagship/teams","hooks_url":"https://api.github.com/repos/yuya-takeyama/flagship/hooks","issue_events_url":"https://api.github.com/repos/yuya-takeyama/flagship/issues/events{/number}","events_url":"https://api.github.com/repos/yuya-takeyama/flagship/events","assignees_url":"https://api.github.com/repos/yuya-takeyama/flagship/assignees{/user}","branches_url":"https://api.github.com/repos/yuya-takeyama/flagship/branches{/branch}","tags_url":"https://api.github.com/repos/yuya-takeyama/flagship/tags","blobs_url":"https://api.github.com/repos/yuya-takeyama/flagship/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yuya-takeyama/flagship/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yuya-takeyama/flagship/git/refs{/sha}","trees_url":"https://api.github.com/repos/yuya-takeyama/flagship/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yuya-takeyama/flagship/statuses/{sha}","languages_url":"https://api.github.com/repos/yuya-takeyama/flagship/languages","stargazers_url":"https://api.github.com/repos/yuya-takeyama/flagship/stargazers","contributors_url":"https://api.github.com/repos/yuya-takeyama/flagship/contributors","subscribers_url":"https://api.github.com/repos/yuya-takeyama/flagship/subscribers","subscription_url":"https://api.github.com/repos/yuya-takeyama/flagship/subscription","commits_url":"https://api.github.com/repos/yuya-takeyama/flagship/commits{/sha}","git_commits_url":"https://api.github.com/repos/yuya-takeyama/flagship/git/commits{/sha}","comments_url":"https://api.github.com/repos/yuya-takeyama/flagship/comments{/number}","issue_comment_url":"https://api.github.com/repos/yuya-takeyama/flagship/issues/comments{/number}","contents_url":"https://api.github.com/repos/yuya-takeyama/flagship/contents/{+path}","compare_url":"https://api.github.com/repos/yuya-takeyama/flagship/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yuya-takeyama/flagship/merges","archive_url":"https://api.github.com/repos/yuya-takeyama/flagship/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yuya-takeyama/flagship/downloads","issues_url":"https://api.github.com/repos/yuya-takeyama/flagship/issues{/number}","pulls_url":"https://api.github.com/repos/yuya-takeyama/flagship/pulls{/number}","milestones_url":"https://api.github.com/repos/yuya-takeyama/flagship/milestones{/number}","notifications_url":"https://api.github.com/repos/yuya-takeyama/flagship/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yuya-takeyama/flagship/labels{/name}","releases_url":"https://api.github.com/repos/yuya-takeyama/flagship/releases{/id}","deployments_url":"https://api.github.com/repos/yuya-takeyama/flagship/deployments","created_at":"2016-10-30T13:02:38Z","updated_at":"2016-11-20T12:49:39Z","pushed_at":"2016-12-22T16:45:53Z","git_url":"git://github.com/yuya-takeyama/flagship.git","ssh_url":"git@github.com:yuya-takeyama/flagship.git","clone_url":"https://github.com/yuya-takeyama/flagship.git","svn_url":"https://github.com/yuya-takeyama/flagship","homepage":"","size":45,"stargazers_count":4,"watchers_count":4,"language":"Ruby","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":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yuya-takeyama/flagship/pulls/21"},"html":{"href":"https://github.com/yuya-takeyama/flagship/pull/21"},"issue":{"href":"https://api.github.com/repos/yuya-takeyama/flagship/issues/21"},"comments":{"href":"https://api.github.com/repos/yuya-takeyama/flagship/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/yuya-takeyama/flagship/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/yuya-takeyama/flagship/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yuya-takeyama/flagship/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/yuya-takeyama/flagship/statuses/0218f31322c53f89e63fdef3e79ee2b16e3fae30"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":3,"additions":166,"deletions":41,"changed_files":4}}
{"actor":{"display_login":"sethjeffery"}}