Class: OnSIP::User

Inherits:
Object
  • Object
show all
Extended by:
ClassMethods
Includes:
Model
Defined in:
lib/onsip/models/user.rb

Defined Under Namespace

Modules: ClassMethods

Instance Attribute Summary

Attributes included from Model

#attributes, #session

Instance Method Summary collapse

Methods included from ClassMethods

browse, edit_status, process_add_user_response, process_browse_user_response, process_delete_user_response, process_edit_user_status_response, process_read_user_response, read

Methods included from Model

#initialize

Instance Method Details

#accountObject



17
18
19
# File 'lib/onsip/models/user.rb', line 17

def 
  Account.read self.
end

#account_idObject



9
10
11
# File 'lib/onsip/models/user.rb', line 9

def 
  @attributes.AccountId
end

#add(organization = nil) ⇒ Object



21
22
23
# File 'lib/onsip/models/user.rb', line 21

def add(organization = nil)
  self.class.add organization, @attributes
end

#addressesObject



33
34
35
# File 'lib/onsip/models/user.rb', line 33

def addresses
  UserAddress.browse({'UserId' => self.id})
end

#delete!Object



25
26
27
# File 'lib/onsip/models/user.rb', line 25

def delete!
  self.class.delete! self.id
end

#idObject



5
6
7
# File 'lib/onsip/models/user.rb', line 5

def id
  @attributes.UserId
end

#organizationObject



29
30
31
# File 'lib/onsip/models/user.rb', line 29

def organization
  @organization ||= Organization.read(self.organization_id)
end

#organization_idObject



13
14
15
# File 'lib/onsip/models/user.rb', line 13

def organization_id
  @attributes.OrganizationId
end