lib/github_api/orgs.rb in github_api-0.9.0 vs lib/github_api/orgs.rb in github_api-0.9.1

- old
+ new

@@ -36,12 +36,11 @@ # # github = Github.new oauth_token: '..' # github.orgs.list # def list(*args) - params = args.extract_options! - normalize! params + params = arguments(args).params response = if (user_name = params.delete("user")) get_request("/users/#{user_name}/orgs", params) else # For the authenticated user @@ -56,14 +55,14 @@ # # = Examples # github = Github.new # github.orgs.get 'github' # - def get(org_name, params={}) - assert_presence_of org_name - normalize! params - get_request("/orgs/#{org_name}", params) + def get(*args) + arguments(args, :required => [:org_name]) + + get_request("/orgs/#{org_name}", arguments.params) end alias :find :get # Edit organization # @@ -82,15 +81,15 @@ # "company": "GitHub", # "email": "support@github.com", # "location": "San Francisco", # "name": "github" # - def edit(org_name, params={}) - assert_presence_of org_name - normalize! params - filter! VALID_ORG_PARAM_NAMES, params + def edit(*args) + arguments(args, :required => [:org_name]) do + sift VALID_ORG_PARAM_NAMES + end - patch_request("/orgs/#{org_name}", params) + patch_request("/orgs/#{org_name}", arguments.params) end end # Orgs end # Github