Module: FileboundClient::Endpoints::Groups

Defined in:
lib/filebound_client/endpoints/groups.rb

Overview

Module for Groups resource endpoint

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object

This will call macros to create resource methods on the fly



6
7
8
9
10
11
# File 'lib/filebound_client/endpoints/groups.rb', line 6

def self.included(klass)
  klass.instance_eval do
    allow_new :group
    allow_all :groups
  end
end

Instance Method Details

#group(group_id, query_params = nil) ⇒ Hash

Retrieves a single group by its key

Parameters:

  • group_id (int)

    the group key

  • query_params (Hash) (defaults to: nil)

    additional query params to send in the request (optional params: filter)

Returns:

  • (Hash)

    the group hash



17
18
19
# File 'lib/filebound_client/endpoints/groups.rb', line 17

def group(group_id, query_params = nil)
  get("/groups/#{group_id}", query_params)
end

#group_projects(group_id, query_params = nil) ⇒ Hash

Retrieves projects assigned to the group

Parameters:

  • group_id (int)

    the group key

  • query_params (Hash) (defaults to: nil)

    additional query params to send in the request (option params: filter)

Returns:

  • (Hash)

    the group hash



25
26
27
# File 'lib/filebound_client/endpoints/groups.rb', line 25

def group_projects(group_id, query_params = nil)
  get("/groups/#{group_id}/projects", query_params)
end