Module: BWAPI::Client::Projects::Sharing

Included in:
BWAPI::Client::Projects
Defined in:
lib/bwapi/client/projects/sharing.rb

Overview

Sharing module for projects/sharing endpoints

Instance Method Summary collapse

Instance Method Details

#default_project_sharingHashie::Mash Also known as: sharing

Default shares of a project

Returns:

  • (Hashie::Mash)

    Default project shares information



10
11
12
# File 'lib/bwapi/client/projects/sharing.rb', line 10

def default_project_sharing
  get "projects/sharing"
end

#project_sharing(id, opts = {}) ⇒ Hashie::Mash

Shares of a project

Parameters:

  • id (Integer)

    Id of project

  • opts (Hash) (defaults to: {})

    options hash of parameters

Returns:

  • (Hashie::Mash)

    Specific project shares



22
23
24
# File 'lib/bwapi/client/projects/sharing.rb', line 22

def project_sharing id, opts={}
  get "projects/#{id}/sharing", opts
end

#project_sharing_user(project_id, user_id) ⇒ Hashie::Mash

User share of a project

Parameters:

  • project_id (Integer)

    Id of project

  • user_id (Integer)

    Id of user

Returns:

  • (Hashie::Mash)

    Share of project for user



42
43
44
# File 'lib/bwapi/client/projects/sharing.rb', line 42

def project_sharing_user project_id, user_id
  get "projects/#{project_id}/sharing/#{user_id}"
end

#update_project_sharing(id, opts = {}) ⇒ Hashie::Mash

Update shares of a project

Parameters:

  • id (Integer)

    Id of project

  • opts (Hash) (defaults to: {})

    options hash of parameters

Returns:

  • (Hashie::Mash)

    Updated project shares



33
34
35
# File 'lib/bwapi/client/projects/sharing.rb', line 33

def update_project_sharing id, opts={}
  put "projects/#{id}/sharing", opts
end

#update_project_sharing_user(project_id, user_id) ⇒ Hashie::Mash

Edit user share of a project

Parameters:

  • project_id (Integer)

    Id of project

  • user_id (Integer)

    Id of user

Returns:

  • (Hashie::Mash)

    Updated share of project for user



51
52
53
# File 'lib/bwapi/client/projects/sharing.rb', line 51

def update_project_sharing_user project_id, user_id
  put "projects/#{project_id}/sharing/#{user_id}"
end