Class: Ahub::Group
Class Method Summary
collapse
Instance Method Summary
collapse
#destroy, #initialize, #update
Class Method Details
.find_by_name(group_name) ⇒ Object
9
10
11
12
|
# File 'lib/ahub/group.rb', line 9
def self.find_by_name(group_name)
matches = find_all
matches.find{|group| group.name.downcase.strip == group_name.downcase.strip}
end
|
Instance Method Details
#add(user_id) ⇒ Object
5
6
7
|
# File 'lib/ahub/group.rb', line 5
def add(user_id)
add_user(user_id)
end
|
#add_user(user_id) ⇒ Object
14
15
16
17
18
19
20
21
22
|
# File 'lib/ahub/group.rb', line 14
def add_user(user_id)
raise Exception("No Group Id") unless id
move_url = "#{self.class.base_url}/#{id}/add.json?users=#{user_id}"
RestClient.put("#{move_url}", self.class.)
true
rescue => e
false
end
|