Class: Ghee::API::Membership::MembershipProxy

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

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

#activate!Object



16
17
18
# File 'lib/ghee/api/users.rb', line 16

def activate!
  connection.patch(path_prefix, {state: "active"}).body
end

#active?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/ghee/api/users.rb', line 13

def active?
  self['state'] == 'active'
end

#admin?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/ghee/api/users.rb', line 10

def admin?
  self['role'] == "admin"
end