Class: Zm::Client::FolderRetentionPoliciesCollection

Inherits:
Object
  • Object
show all
Includes:
MissingMethodStaticCollection
Defined in:
lib/zm/client/folder/folder_retention_policies_collection.rb

Overview

class for folder retention policies collection

Instance Attribute Summary

Attributes included from MissingMethodStaticCollection

#all

Instance Method Summary collapse

Methods included from MissingMethodStaticCollection

#method_missing

Constructor Details

#initialize(parent) ⇒ FolderRetentionPoliciesCollection

Returns a new instance of FolderRetentionPoliciesCollection.



9
10
11
12
# File 'lib/zm/client/folder/folder_retention_policies_collection.rb', line 9

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 Method Details

#add(retention_policy) ⇒ Object



23
24
25
# File 'lib/zm/client/folder/folder_retention_policies_collection.rb', line 23

def add(retention_policy)
  @all << retention_policy
end

#create(policy, lifetime, type) ⇒ Object



18
19
20
21
# File 'lib/zm/client/folder/folder_retention_policies_collection.rb', line 18

def create(policy, lifetime, type)
  frp = new(policy, lifetime, type)
  add(frp)
end

#new(policy, lifetime, type) ⇒ Object



14
15
16
# File 'lib/zm/client/folder/folder_retention_policies_collection.rb', line 14

def new(policy, lifetime, type)
  FolderRetentionPolicy.new(self, policy, lifetime, type)
end

#save!Object



27
28
29
30
# File 'lib/zm/client/folder/folder_retention_policies_collection.rb', line 27

def save!
  @parent.sacc.invoke(jsns_builder.to_retentionpolicy)
  true
end