Class: CrowdUser

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

Overview

Wrapper around SOAPPrincipal which provides easy access to attributes

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(soap_principal) ⇒ CrowdUser

Returns a new instance of CrowdUser.



256
257
258
259
260
261
262
263
264
265
266
267
268
# File 'lib/crowd/crowd.rb', line 256

def initialize(soap_principal)
  @soap_principal = soap_principal
  
  @user_id = soap_principal.iD
  @active = soap_principal.active
  @conception = soap_principal.conception
  @description = soap_principal.description
  @directory_id = soap_principal.directoryID
  @last_modified = soap_principal.lastModified
  @name = soap_principal.name

  process_attributes_array soap_principal
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(attribute_name) ⇒ Object

allow attributes to be fetched by name

user.mail instead of user.attributes['mail']

returns nil is the attibute does not exist



275
276
277
# File 'lib/crowd/crowd.rb', line 275

def method_missing(attribute_name)
  @attributes["#{attribute_name}"]
end

Instance Attribute Details

#activeObject (readonly)

Returns the value of attribute active.



245
246
247
# File 'lib/crowd/crowd.rb', line 245

def active
  @active
end

#attributesObject (readonly)

Returns the value of attribute attributes.



246
247
248
# File 'lib/crowd/crowd.rb', line 246

def attributes
  @attributes
end

#conceptionObject (readonly)

Returns the value of attribute conception.



247
248
249
# File 'lib/crowd/crowd.rb', line 247

def conception
  @conception
end

#descriptionObject (readonly)

Returns the value of attribute description.



248
249
250
# File 'lib/crowd/crowd.rb', line 248

def description
  @description
end

#directory_idObject (readonly)

Returns the value of attribute directory_id.



249
250
251
# File 'lib/crowd/crowd.rb', line 249

def directory_id
  @directory_id
end

#emailObject (readonly)

:nodoc:



254
255
256
# File 'lib/crowd/crowd.rb', line 254

def email
  @email
end

#first_nameObject (readonly)

:nodoc:



254
255
256
# File 'lib/crowd/crowd.rb', line 254

def first_name
  @first_name
end

#full_nameObject (readonly)

:nodoc:



254
255
256
# File 'lib/crowd/crowd.rb', line 254

def full_name
  @full_name
end

#last_modifiedObject (readonly)

Returns the value of attribute last_modified.



250
251
252
# File 'lib/crowd/crowd.rb', line 250

def last_modified
  @last_modified
end

#last_nameObject (readonly)

:nodoc:



254
255
256
# File 'lib/crowd/crowd.rb', line 254

def last_name
  @last_name
end

#nameObject (readonly)

Returns the value of attribute name.



251
252
253
# File 'lib/crowd/crowd.rb', line 251

def name
  @name
end

#user_idObject (readonly)

Returns the value of attribute user_id.



244
245
246
# File 'lib/crowd/crowd.rb', line 244

def user_id
  @user_id
end