{"action":"closed","number":68,"pull_request":{"url":"https://api.github.com/repos/adomokos/light-service/pulls/68","id":39206218,"html_url":"https://github.com/adomokos/light-service/pull/68","diff_url":"https://github.com/adomokos/light-service/pull/68.diff","patch_url":"https://github.com/adomokos/light-service/pull/68.patch","issue_url":"https://api.github.com/repos/adomokos/light-service/issues/68","number":68,"state":"closed","locked":false,"title":"Context key aliases","user":{"login":"jpmoral","id":834615,"avatar_url":"https://avatars.githubusercontent.com/u/834615?v=3","gravatar_id":"","url":"https://api.github.com/users/jpmoral","html_url":"https://github.com/jpmoral","followers_url":"https://api.github.com/users/jpmoral/followers","following_url":"https://api.github.com/users/jpmoral/following{/other_user}","gists_url":"https://api.github.com/users/jpmoral/gists{/gist_id}","starred_url":"https://api.github.com/users/jpmoral/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpmoral/subscriptions","organizations_url":"https://api.github.com/users/jpmoral/orgs","repos_url":"https://api.github.com/users/jpmoral/repos","events_url":"https://api.github.com/users/jpmoral/events{/privacy}","received_events_url":"https://api.github.com/users/jpmoral/received_events","type":"User","site_admin":false},"body":"This addresses #67.  An `aliases` macro was added to the Organizer module.  It accepts a hash; the keys are the original keys and the values are the key aliases.\r\n\r\nThis is passed to `WithReducer#with`.  `WithReducer#reduce` inserts new key-value pairs into the context: the keys are the key aliases while the values are the values corresponding to the original keys.  Thus each action can use the aliases when accessing the context.  Example usage:\r\n\r\n```ruby\r\nclass AnOrganizer\r\n  extend LightService::Organizer\r\n\r\n  aliases my_key: :key_alias\r\n\r\n  def self.for_order(order)\r\n    with(:order => order).reduce(\r\n        AnAction,\r\n        AnotherAction,\r\n      )\r\n  end\r\nend\r\n\r\nclass AnAction\r\n  extend LightService::Action\r\n  promises :my_key\r\n\r\n  executed do |context|\r\n    context.my_key = \"value\"\r\n  end\r\nend\r\n\r\nclass AnotherAction\r\n  extend LightService::Action\r\n  expects :key_alias\r\n\r\n  executed do |context|\r\n    context.key_alias # => \"value\"\r\n  end\r\nend\r\n```\r\n\r\nSee `spec/organizer_key_aliases_spec.rb` for more.","created_at":"2015-07-04T10:50:21Z","updated_at":"2015-07-08T07:44:40Z","closed_at":"2015-07-08T07:44:40Z","merged_at":null,"merge_commit_sha":"3999e2c94eebd251aace061d9157a437d3bfade2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/adomokos/light-service/pulls/68/commits","review_comments_url":"https://api.github.com/repos/adomokos/light-service/pulls/68/comments","review_comment_url":"https://api.github.com/repos/adomokos/light-service/pulls/comments{/number}","comments_url":"https://api.github.com/repos/adomokos/light-service/issues/68/comments","statuses_url":"https://api.github.com/repos/adomokos/light-service/statuses/eccd80148c69cc0275d68e194fffd6c7ac8e66ac","head":{"label":"jpmoral:key-aliases","ref":"key-aliases","sha":"eccd80148c69cc0275d68e194fffd6c7ac8e66ac","user":{"login":"jpmoral","id":834615,"avatar_url":"https://avatars.githubusercontent.com/u/834615?v=3","gravatar_id":"","url":"https://api.github.com/users/jpmoral","html_url":"https://github.com/jpmoral","followers_url":"https://api.github.com/users/jpmoral/followers","following_url":"https://api.github.com/users/jpmoral/following{/other_user}","gists_url":"https://api.github.com/users/jpmoral/gists{/gist_id}","starred_url":"https://api.github.com/users/jpmoral/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpmoral/subscriptions","organizations_url":"https://api.github.com/users/jpmoral/orgs","repos_url":"https://api.github.com/users/jpmoral/repos","events_url":"https://api.github.com/users/jpmoral/events{/privacy}","received_events_url":"https://api.github.com/users/jpmoral/received_events","type":"User","site_admin":false},"repo":{"id":38515326,"name":"light-service","full_name":"jpmoral/light-service","owner":{"login":"jpmoral","id":834615,"avatar_url":"https://avatars.githubusercontent.com/u/834615?v=3","gravatar_id":"","url":"https://api.github.com/users/jpmoral","html_url":"https://github.com/jpmoral","followers_url":"https://api.github.com/users/jpmoral/followers","following_url":"https://api.github.com/users/jpmoral/following{/other_user}","gists_url":"https://api.github.com/users/jpmoral/gists{/gist_id}","starred_url":"https://api.github.com/users/jpmoral/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpmoral/subscriptions","organizations_url":"https://api.github.com/users/jpmoral/orgs","repos_url":"https://api.github.com/users/jpmoral/repos","events_url":"https://api.github.com/users/jpmoral/events{/privacy}","received_events_url":"https://api.github.com/users/jpmoral/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jpmoral/light-service","description":"Series of Actions with an emphasis on simplicity.","fork":true,"url":"https://api.github.com/repos/jpmoral/light-service","forks_url":"https://api.github.com/repos/jpmoral/light-service/forks","keys_url":"https://api.github.com/repos/jpmoral/light-service/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jpmoral/light-service/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jpmoral/light-service/teams","hooks_url":"https://api.github.com/repos/jpmoral/light-service/hooks","issue_events_url":"https://api.github.com/repos/jpmoral/light-service/issues/events{/number}","events_url":"https://api.github.com/repos/jpmoral/light-service/events","assignees_url":"https://api.github.com/repos/jpmoral/light-service/assignees{/user}","branches_url":"https://api.github.com/repos/jpmoral/light-service/branches{/branch}","tags_url":"https://api.github.com/repos/jpmoral/light-service/tags","blobs_url":"https://api.github.com/repos/jpmoral/light-service/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jpmoral/light-service/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jpmoral/light-service/git/refs{/sha}","trees_url":"https://api.github.com/repos/jpmoral/light-service/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jpmoral/light-service/statuses/{sha}","languages_url":"https://api.github.com/repos/jpmoral/light-service/languages","stargazers_url":"https://api.github.com/repos/jpmoral/light-service/stargazers","contributors_url":"https://api.github.com/repos/jpmoral/light-service/contributors","subscribers_url":"https://api.github.com/repos/jpmoral/light-service/subscribers","subscription_url":"https://api.github.com/repos/jpmoral/light-service/subscription","commits_url":"https://api.github.com/repos/jpmoral/light-service/commits{/sha}","git_commits_url":"https://api.github.com/repos/jpmoral/light-service/git/commits{/sha}","comments_url":"https://api.github.com/repos/jpmoral/light-service/comments{/number}","issue_comment_url":"https://api.github.com/repos/jpmoral/light-service/issues/comments{/number}","contents_url":"https://api.github.com/repos/jpmoral/light-service/contents/{+path}","compare_url":"https://api.github.com/repos/jpmoral/light-service/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jpmoral/light-service/merges","archive_url":"https://api.github.com/repos/jpmoral/light-service/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jpmoral/light-service/downloads","issues_url":"https://api.github.com/repos/jpmoral/light-service/issues{/number}","pulls_url":"https://api.github.com/repos/jpmoral/light-service/pulls{/number}","milestones_url":"https://api.github.com/repos/jpmoral/light-service/milestones{/number}","notifications_url":"https://api.github.com/repos/jpmoral/light-service/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jpmoral/light-service/labels{/name}","releases_url":"https://api.github.com/repos/jpmoral/light-service/releases{/id}","created_at":"2015-07-04T00:16:28Z","updated_at":"2015-07-04T00:16:28Z","pushed_at":"2015-07-08T06:18:37Z","git_url":"git://github.com/jpmoral/light-service.git","ssh_url":"git@github.com:jpmoral/light-service.git","clone_url":"https://github.com/jpmoral/light-service.git","svn_url":"https://github.com/jpmoral/light-service","homepage":"","size":616,"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":"adomokos:master","ref":"master","sha":"cb67e29cae643e4e891bd548992e8c289cd0af6a","user":{"login":"adomokos","id":80530,"avatar_url":"https://avatars.githubusercontent.com/u/80530?v=3","gravatar_id":"","url":"https://api.github.com/users/adomokos","html_url":"https://github.com/adomokos","followers_url":"https://api.github.com/users/adomokos/followers","following_url":"https://api.github.com/users/adomokos/following{/other_user}","gists_url":"https://api.github.com/users/adomokos/gists{/gist_id}","starred_url":"https://api.github.com/users/adomokos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adomokos/subscriptions","organizations_url":"https://api.github.com/users/adomokos/orgs","repos_url":"https://api.github.com/users/adomokos/repos","events_url":"https://api.github.com/users/adomokos/events{/privacy}","received_events_url":"https://api.github.com/users/adomokos/received_events","type":"User","site_admin":false},"repo":{"id":6458053,"name":"light-service","full_name":"adomokos/light-service","owner":{"login":"adomokos","id":80530,"avatar_url":"https://avatars.githubusercontent.com/u/80530?v=3","gravatar_id":"","url":"https://api.github.com/users/adomokos","html_url":"https://github.com/adomokos","followers_url":"https://api.github.com/users/adomokos/followers","following_url":"https://api.github.com/users/adomokos/following{/other_user}","gists_url":"https://api.github.com/users/adomokos/gists{/gist_id}","starred_url":"https://api.github.com/users/adomokos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adomokos/subscriptions","organizations_url":"https://api.github.com/users/adomokos/orgs","repos_url":"https://api.github.com/users/adomokos/repos","events_url":"https://api.github.com/users/adomokos/events{/privacy}","received_events_url":"https://api.github.com/users/adomokos/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/adomokos/light-service","description":"Series of Actions with an emphasis on simplicity.","fork":false,"url":"https://api.github.com/repos/adomokos/light-service","forks_url":"https://api.github.com/repos/adomokos/light-service/forks","keys_url":"https://api.github.com/repos/adomokos/light-service/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adomokos/light-service/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adomokos/light-service/teams","hooks_url":"https://api.github.com/repos/adomokos/light-service/hooks","issue_events_url":"https://api.github.com/repos/adomokos/light-service/issues/events{/number}","events_url":"https://api.github.com/repos/adomokos/light-service/events","assignees_url":"https://api.github.com/repos/adomokos/light-service/assignees{/user}","branches_url":"https://api.github.com/repos/adomokos/light-service/branches{/branch}","tags_url":"https://api.github.com/repos/adomokos/light-service/tags","blobs_url":"https://api.github.com/repos/adomokos/light-service/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adomokos/light-service/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adomokos/light-service/git/refs{/sha}","trees_url":"https://api.github.com/repos/adomokos/light-service/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adomokos/light-service/statuses/{sha}","languages_url":"https://api.github.com/repos/adomokos/light-service/languages","stargazers_url":"https://api.github.com/repos/adomokos/light-service/stargazers","contributors_url":"https://api.github.com/repos/adomokos/light-service/contributors","subscribers_url":"https://api.github.com/repos/adomokos/light-service/subscribers","subscription_url":"https://api.github.com/repos/adomokos/light-service/subscription","commits_url":"https://api.github.com/repos/adomokos/light-service/commits{/sha}","git_commits_url":"https://api.github.com/repos/adomokos/light-service/git/commits{/sha}","comments_url":"https://api.github.com/repos/adomokos/light-service/comments{/number}","issue_comment_url":"https://api.github.com/repos/adomokos/light-service/issues/comments{/number}","contents_url":"https://api.github.com/repos/adomokos/light-service/contents/{+path}","compare_url":"https://api.github.com/repos/adomokos/light-service/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adomokos/light-service/merges","archive_url":"https://api.github.com/repos/adomokos/light-service/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adomokos/light-service/downloads","issues_url":"https://api.github.com/repos/adomokos/light-service/issues{/number}","pulls_url":"https://api.github.com/repos/adomokos/light-service/pulls{/number}","milestones_url":"https://api.github.com/repos/adomokos/light-service/milestones{/number}","notifications_url":"https://api.github.com/repos/adomokos/light-service/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adomokos/light-service/labels{/name}","releases_url":"https://api.github.com/repos/adomokos/light-service/releases{/id}","created_at":"2012-10-30T13:56:13Z","updated_at":"2015-06-30T18:45:42Z","pushed_at":"2015-07-08T07:44:00Z","git_url":"git://github.com/adomokos/light-service.git","ssh_url":"git@github.com:adomokos/light-service.git","clone_url":"https://github.com/adomokos/light-service.git","svn_url":"https://github.com/adomokos/light-service","homepage":"","size":1659,"stargazers_count":167,"watchers_count":167,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":17,"mirror_url":null,"open_issues_count":5,"forks":17,"open_issues":5,"watchers":167,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/adomokos/light-service/pulls/68"},"html":{"href":"https://github.com/adomokos/light-service/pull/68"},"issue":{"href":"https://api.github.com/repos/adomokos/light-service/issues/68"},"comments":{"href":"https://api.github.com/repos/adomokos/light-service/issues/68/comments"},"review_comments":{"href":"https://api.github.com/repos/adomokos/light-service/pulls/68/comments"},"review_comment":{"href":"https://api.github.com/repos/adomokos/light-service/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/adomokos/light-service/pulls/68/commits"},"statuses":{"href":"https://api.github.com/repos/adomokos/light-service/statuses/eccd80148c69cc0275d68e194fffd6c7ac8e66ac"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":7,"review_comments":2,"commits":14,"additions":130,"deletions":23,"changed_files":9}}