Class: Levelup::Endpoints::PermissionsRequests

Inherits:
Base
  • Object
show all
Defined in:
lib/levelup/endpoints/permissions_requests.rb

Overview

The endpoint holding all functions related to managing permissions requests.

Instance Method Summary collapse

Constructor Details

#initialize(app_access_token) ⇒ PermissionsRequests

Returns a new instance of PermissionsRequests



5
6
7
# File 'lib/levelup/endpoints/permissions_requests.rb', line 5

def initialize(app_access_token)
  self.app_access_token = app_access_token
end

Instance Method Details

#create(user_permissions_request) ⇒ Object

Requests a set of permissions from the specified user. See RequestPermissionsRequest for more detail about parameters.



11
12
13
14
15
16
# File 'lib/levelup/endpoints/permissions_requests.rb', line 11

def create(user_permissions_request)
  request = build_request(user_permissions_request,
    Requests::RequestPermissions)
  request.app_access_token ||= app_access_token
  request.send_to_api(:post, endpoint_path)
end