Class: Ghee::API::Orgs::Teams::Members::Proxy

Inherits:
ResourceProxy show all
Defined in:
lib/ghee/api/orgs.rb

Overview

Members::Proxy inherits from Ghee::Proxy and enables defining methods on the proxy object

Instance Attribute Summary

Attributes inherited from ResourceProxy

#connection, #current_page, #id, #pagination, #params, #path_prefix, #total

Instance Method Summary collapse

Methods inherited from ResourceProxy

accept_header, #all, #all_parallel, #build_prefix, #initialize, #method_missing, #paginate, #raw, #subject

Methods included from CUD

#create, #destroy, #patch

Constructor Details

This class inherits a constructor from Ghee::ResourceProxy

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Ghee::ResourceProxy

Instance Method Details

#add(member) ⇒ Object



33
34
35
# File 'lib/ghee/api/orgs.rb', line 33

def add(member)
  connection.put("#{path_prefix}/#{member}").status == 204
end

#check?(username = nil) ⇒ Boolean

Returns:

  • (Boolean)


40
41
42
43
# File 'lib/ghee/api/orgs.rb', line 40

def check?(username=nil)
  prefix = username ? File.join(path_prefix, username) : path_prefix
  connection.get(prefix).status == 204
end

#remove(member) ⇒ Object



37
38
39
# File 'lib/ghee/api/orgs.rb', line 37

def remove(member)
  connection.delete("#{path_prefix}/#{member}").status == 204
end