Class: Zm::Client::FolderGrantsCollection
- Inherits:
-
Object
- Object
- Zm::Client::FolderGrantsCollection
- Includes:
- MissingMethodStaticCollection
- Defined in:
- lib/zm/client/folder/folder_grants_collection.rb
Overview
class for folder retention policies collection
Instance Attribute Summary collapse
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
Attributes included from MissingMethodStaticCollection
Instance Method Summary collapse
- #add(fg) ⇒ Object
- #create(zid, gt, perm, d) ⇒ Object
- #create_from_object(item, perm) ⇒ Object
-
#initialize(parent) ⇒ FolderGrantsCollection
constructor
A new instance of FolderGrantsCollection.
- #new(zid, gt, perm, d) ⇒ Object
- #new_from_object(item, perm) ⇒ Object
- #soap_account_connector ⇒ Object (also: #sacc)
- #to_s ⇒ Object
Methods included from MissingMethodStaticCollection
Constructor Details
#initialize(parent) ⇒ FolderGrantsCollection
Returns a new instance of FolderGrantsCollection.
11 12 13 14 |
# File 'lib/zm/client/folder/folder_grants_collection.rb', line 11 def initialize(parent) @parent = parent @all = [] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class MissingMethodStaticCollection
Instance Attribute Details
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
9 10 11 |
# File 'lib/zm/client/folder/folder_grants_collection.rb', line 9 def parent @parent end |
Instance Method Details
#add(fg) ⇒ Object
54 55 56 |
# File 'lib/zm/client/folder/folder_grants_collection.rb', line 54 def add(fg) @all << fg end |
#create(zid, gt, perm, d) ⇒ Object
42 43 44 45 46 |
# File 'lib/zm/client/folder/folder_grants_collection.rb', line 42 def create(zid, gt, perm, d) fg = new(zid, gt, perm, d) add(fg) fg end |
#create_from_object(item, perm) ⇒ Object
48 49 50 51 52 |
# File 'lib/zm/client/folder/folder_grants_collection.rb', line 48 def create_from_object(item, perm) fg = new_from_object(item, perm) add(fg) fg end |
#new(zid, gt, perm, d) ⇒ Object
38 39 40 |
# File 'lib/zm/client/folder/folder_grants_collection.rb', line 38 def new(zid, gt, perm, d) FolderGrant.new(self, zid, gt, perm, d) end |
#new_from_object(item, perm) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/zm/client/folder/folder_grants_collection.rb', line 16 def new_from_object(item, perm) case item when Account zid = item.id gt = FolderGrant::GT_USER when Resource zid = item.id gt = FolderGrant::GT_USER when DistributionList zid = item.id gt = FolderGrant::GT_GROUP when Domain zid = item.id gt = FolderGrant::GT_DOMAIN else zid = nil gt = nil end new(zid, gt, perm, nil) end |
#soap_account_connector ⇒ Object Also known as: sacc
58 59 60 |
# File 'lib/zm/client/folder/folder_grants_collection.rb', line 58 def soap_account_connector @parent.parent.soap_account_connector end |
#to_s ⇒ Object
64 65 66 |
# File 'lib/zm/client/folder/folder_grants_collection.rb', line 64 def to_s @all.map(&:to_s) end |