def received(*args)
      arguments(args, required: [:user])
      params = arguments.params

      public_events = if params['public']
        params.delete('public')
        '/public'
      end

      response = get_request("/users/#{arguments.user}/received_events#{public_events}", params)
      return response unless block_given?
      response.each { |el| yield el }
    end
def received(*args)
      arguments(args, required: [:user])
      params = arguments.params

      public_events = if params['public']
        params.delete('public')
        '/public'
      end

      response = get_request("/users/#{arguments.user}/received_events#{public_events}", params)
      return response unless block_given?
      response.each { |el| yield el }
    end
List all events that a user has received

 @see https://developer.github.com/v3/activity/events/#list-events-that-a-user-has-received

 These are events that you’ve received by watching repos
 and following users. If you are authenticated as the given user,
 you will see private events. Otherwise, you’ll only see public events.

 @example
   github = Github.new
   github.activity.events.received 'user-name'
   github.activity.events.received 'user-name' { |event| ... }

 List all public events that a user has received

 @see https://developer.github.com/v3/activity/events/#list-public-events-that-a-user-has-received

 @example
   github = Github.new
   github.activity.events.received 'user-name', public: true
   github.activity.events.received 'user-name', public: true { |event| ... }

 @api public