def list(*args)
      arguments(args, required: [:user, :repo]) do
        permit VALID_MILESTONE_OPTIONS.keys
        assert_values VALID_MILESTONE_OPTIONS
      end

      response = get_request("/repos/#{arguments.user}/#{arguments.repo}/milestones", arguments.params)
      return response unless block_given?
      response.each { |el| yield el }
    end
def list(*args)
      arguments(args, required: [:user, :repo]) do
        permit VALID_MILESTONE_OPTIONS.keys
        assert_values VALID_MILESTONE_OPTIONS
      end

      response = get_request("/repos/#{arguments.user}/#{arguments.repo}/milestones", arguments.params)
      return response unless block_given?
      response.each { |el| yield el }
    end
:nodoc:
 List milestones for a repository

 @param [Hash] params
 @option params [String] :state
   The state of the milestone. Either open, closed, or all. Default: open
 @option params [String] :sort
   What to sort results by. Either due_date or completeness.
   Default: due_date
 @option params [String] :direction
   The directoin of the sort. Either asc or desc. Default: desc

 @example
  github = Github.new user: 'user-name', repo: 'repo-name'
  github.issues.milestones.list

 @example
  github.issues.milestones.list state: 'open', sort: 'due_date',
    direction: 'asc'

 @api public