Class: ActiveSP::Group
- Inherits:
-
Base
- Object
- Base
- ActiveSP::Group
- Extended by:
- Caching, PersistentCaching
- Includes:
- InSite, Util
- Defined in:
- lib/activesp/group.rb
Instance Method Summary (collapse)
-
- (Group) initialize(site, name)
constructor
A new instance of Group.
-
- (Boolean) is_role?
Returns false.
-
- (String) key
See Base#key.
-
- (void) save
See Base#save.
- - (Object) to_s (also: #inspect)
-
- (User) users
Returns the list of users in this group.
Methods included from Caching
Methods inherited from Base
#attribute, #attribute_type, #attribute_types, #attributes, #has_attribute?, #has_writable_attribute?, #method_missing, #reload, #set_attribute
Constructor Details
- (Group) initialize(site, name)
A new instance of Group
37 38 39 |
# File 'lib/activesp/group.rb', line 37 def initialize(site, name) @site, @name = site, name end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ActiveSP::Base
Instance Method Details
- (Boolean) is_role?
Returns false. The same method is present on Role where it returns true. Roles and groups can generally be duck-typed, and this method is there for the rare case where you do need to make the distinction
60 61 62 |
# File 'lib/activesp/group.rb', line 60 def is_role? false end |
- (String) key
See Base#key
43 44 45 |
# File 'lib/activesp/group.rb', line 43 def key encode_key("G", [@name]) end |
- (void) save
This method returns an undefined value.
See Base#save
66 67 68 |
# File 'lib/activesp/group.rb', line 66 def save p untype_cast_attributes(@site, nil, internal_attribute_types, changed_attributes) end |
- (Object) to_s Also known as: inspect
71 72 73 |
# File 'lib/activesp/group.rb', line 71 def to_s "#<ActiveSP::Group name=#{@name}>" end |
- (User) users
Returns the list of users in this group
49 50 51 52 53 54 |
# File 'lib/activesp/group.rb', line 49 def users call("UserGroup", "get_user_collection_from_group", "groupName" => @name).xpath("//spdir:User", NS).map do |row| attributes = clean_attributes(row.attributes) User.new(@site, attributes["LoginName"]) end end |