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

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

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



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

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



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

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



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

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



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

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



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

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