Class: ActiveSP::Group
- Extended by:
- Caching, PersistentCaching
- Defined in:
- lib/activesp/group.rb
Instance Method Summary collapse
-
#initialize(site, name) ⇒ Group
constructor
A new instance of Group.
-
#is_role? ⇒ Boolean
Returns false.
-
#key ⇒ String
See Base#key.
-
#save ⇒ void
See Base#save.
- #to_s ⇒ Object (also: #inspect)
-
#users ⇒ User
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
#initialize(site, name) ⇒ Group
Returns 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
#is_role? ⇒ Boolean
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 |
#key ⇒ String
See Base#key
43 44 45 |
# File 'lib/activesp/group.rb', line 43 def key encode_key("G", [@name]) end |
#save ⇒ void
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 |
#to_s ⇒ Object Also known as: inspect
71 72 73 |
# File 'lib/activesp/group.rb', line 71 def to_s "#<ActiveSP::Group name=#{@name}>" end |
#users ⇒ User
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 |