Class: Zimbra::Account

Inherits:
Object
  • Object
show all
Defined in:
lib/zimbra/account.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Account

Returns a new instance of Account.



28
29
30
31
32
33
34
35
# File 'lib/zimbra/account.rb', line 28

def initialize(options = {})
  self.id = options[:id]
  self.name = options[:name]
  self.password = options[:password]
  self.acls = options[:acls] || []
  self.cos_id = (options[:cos] ? options[:cos].id : options[:cos_id])
  self.delegated_admin = options[:delegated_admin]
end

Instance Attribute Details

#aclsObject

Returns the value of attribute acls.



26
27
28
# File 'lib/zimbra/account.rb', line 26

def acls
  @acls
end

#cos_idObject

Returns the value of attribute cos_id.



26
27
28
# File 'lib/zimbra/account.rb', line 26

def cos_id
  @cos_id
end

#delegated_adminObject

Returns the value of attribute delegated_admin.



26
27
28
# File 'lib/zimbra/account.rb', line 26

def delegated_admin
  @delegated_admin
end

#idObject

Returns the value of attribute id.



26
27
28
# File 'lib/zimbra/account.rb', line 26

def id
  @id
end

#nameObject

Returns the value of attribute name.



26
27
28
# File 'lib/zimbra/account.rb', line 26

def name
  @name
end

#passwordObject

Returns the value of attribute password.



26
27
28
# File 'lib/zimbra/account.rb', line 26

def password
  @password
end

Class Method Details

.acl_nameObject



21
22
23
# File 'lib/zimbra/account.rb', line 21

def acl_name
  'account'
end

.allObject



4
5
6
# File 'lib/zimbra/account.rb', line 4

def all
  AccountService.all
end

.create(options) ⇒ Object



16
17
18
19
# File 'lib/zimbra/account.rb', line 16

def create(options)
   = new(options)
  AccountService.create() 
end

.find_by_id(id) ⇒ Object



8
9
10
# File 'lib/zimbra/account.rb', line 8

def find_by_id(id)
  AccountService.get_by_id(id)
end

.find_by_name(name) ⇒ Object



12
13
14
# File 'lib/zimbra/account.rb', line 12

def find_by_name(name)
  AccountService.get_by_name(name)
end

Instance Method Details

#delegated_admin?Boolean

Returns:



40
41
42
# File 'lib/zimbra/account.rb', line 40

def delegated_admin?
  @delegated_admin
end

#deleteObject



48
49
50
# File 'lib/zimbra/account.rb', line 48

def delete
  AccountService.delete(self)
end

#saveObject



44
45
46
# File 'lib/zimbra/account.rb', line 44

def save
  AccountService.modify(self)
end