Class: AWS::IAM::UserGroupCollection
- Inherits:
-
Object
- Object
- AWS::IAM::UserGroupCollection
- Includes:
- Collection
- Defined in:
- lib/aws/iam/user_group_collection.rb
Overview
Instance Attribute Summary collapse
- #user ⇒ Object readonly
Instance Method Summary collapse
-
#add(group) ⇒ Object
Adds the user to a group.
-
#clear ⇒ nil
Removes this user from all groups.
-
#each(options = {}) {|group| ... } ⇒ nil
Yields once for each group that the user is in.
-
#remove(group) ⇒ Object
Removes the user from a group.
Instance Attribute Details
#user ⇒ Object (readonly)
32 33 34 |
# File 'lib/aws/iam/user_group_collection.rb', line 32 def user @user end |
Instance Method Details
#add(group) ⇒ Object
Adds the user to a group.
43 44 45 46 47 |
# File 'lib/aws/iam/user_group_collection.rb', line 43 def add(group) client.add_user_to_group(:group_name => group.name, :user_name => user.name) nil end |
#clear ⇒ nil
Removes this user from all groups.
60 61 62 63 64 |
# File 'lib/aws/iam/user_group_collection.rb', line 60 def clear each do |group| remove(group) end end |
#each(options = {}) {|group| ... } ⇒ nil
Yields once for each group that the user is in.
79 80 81 |
# File 'lib/aws/iam/user_group_collection.rb', line 79 def each( = {}, &block) super(.merge(:user_name => user.name), &block) end |
#remove(group) ⇒ Object
Removes the user from a group.
52 53 54 55 56 |
# File 'lib/aws/iam/user_group_collection.rb', line 52 def remove(group) client.remove_user_from_group(:group_name => group.name, :user_name => user.name) nil end |