Class: Board::Client::UserOrganizations

Inherits:
API
  • Object
show all
Defined in:
lib/board/client/user_organizations.rb

Instance Method Summary collapse

Methods inherited from API

#get, #initialize, #post

Constructor Details

This class inherits a constructor from Board::Client::API

Instance Method Details

#create(attributes) ⇒ Object



12
13
14
15
16
17
# File 'lib/board/client/user_organizations.rb', line 12

def create(attributes)
  user_id = attributes.fetch(:user_id)
  organization_id = attributes.fetch(:organization_id)

  post("/users/#{user_id}/organizations", :id => organization_id)
end

#list(attributes) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/board/client/user_organizations.rb', line 4

def list(attributes)
  user_id = attributes.fetch(:user_id) {
    raise ArgumentError, "user_id is required"
  }

  get("/users/#{user_id}/organizations")
end