Class: LabClient::Membership
Overview
Constant Summary
Constants included
from AccessLevel
AccessLevel::HUMAN_ACCESS_LEVELS, AccessLevel::MACHINE_ACCESS_LEVELS
Instance Attribute Summary
Attributes inherited from Klass
#client
Attributes inherited from LabStruct
#response, #table
Instance Method Summary
collapse
#human_access_level, #human_protected_access_level, #machine_access_level, #machine_protected_access_level
#has?, #keys, #raw
Methods inherited from Klass
#api_methods, #collect_project_id, #collect_release_id, #collect_repository_id, date_time_attrs, #format_time?, #group_name, #help, #initialize, #klass, #quiet?, #success?, #to_json, #update_self, user_attrs, #valid_group_project_levels, #verbose
Methods included from Docs
#demo, #desc, #doc, docs, #example, #group_name, #help, json, #markdown, #navigation, #option, #result, #subtitle, #title
Methods included from CurlHelper
#curl
Methods included from Logger
#logger, logger, logger_setup
Methods inherited from LabStruct
#[], #[]=, #as_json, #client, #initialize, #key?, #keys, #method_missing, #respond_to_missing?, #slice, #success?, #to_h
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class LabClient::LabStruct
Instance Method Details
#developer? ⇒ Boolean
33
34
35
|
# File 'lib/labclient/users/membership.rb', line 33
def developer?
level == :developer
end
|
#greater_than(leveler) ⇒ Object
45
46
47
48
49
50
51
52
|
# File 'lib/labclient/users/membership.rb', line 45
def greater_than(leveler)
case leveler
when Symbol
access_level > machine_access_level(leveler)
when Integer
access_level > leveler
end
end
|
#guest? ⇒ Boolean
25
26
27
|
# File 'lib/labclient/users/membership.rb', line 25
def guest?
level == :guest
end
|
#inspect ⇒ Object
8
9
10
|
# File 'lib/labclient/users/membership.rb', line 8
def inspect
"#<Membership name: #{source_name}, access: #{level}>"
end
|
#level ⇒ Object
21
22
23
|
# File 'lib/labclient/users/membership.rb', line 21
def level
human_access_level(access_level)
end
|
#maintainer? ⇒ Boolean
37
38
39
|
# File 'lib/labclient/users/membership.rb', line 37
def maintainer?
level == :maintainer
end
|
#owner? ⇒ Boolean
41
42
43
|
# File 'lib/labclient/users/membership.rb', line 41
def owner?
level == :owner
end
|
#parent ⇒ Object
12
13
14
15
16
17
18
19
|
# File 'lib/labclient/users/membership.rb', line 12
def parent
case source_type
when 'Project'
client.projects.show(source_id)
when 'Namespace'
client.groups.show(source_id)
end
end
|
#reporter? ⇒ Boolean
29
30
31
|
# File 'lib/labclient/users/membership.rb', line 29
def reporter?
level == :reporter
end
|