Class: CrowdUser
- Inherits:
-
Object
- Object
- CrowdUser
- Defined in:
- lib/crowd/crowd.rb
Overview
Wrapper around SOAPPrincipal which provides easy access to attributes
Instance Attribute Summary collapse
-
#active ⇒ Object
readonly
Returns the value of attribute active.
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#conception ⇒ Object
readonly
Returns the value of attribute conception.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#directory_id ⇒ Object
readonly
Returns the value of attribute directory_id.
-
#email ⇒ Object
readonly
:nodoc:.
-
#first_name ⇒ Object
readonly
:nodoc:.
-
#full_name ⇒ Object
readonly
:nodoc:.
-
#last_modified ⇒ Object
readonly
Returns the value of attribute last_modified.
-
#last_name ⇒ Object
readonly
:nodoc:.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#user_id ⇒ Object
readonly
Returns the value of attribute user_id.
Instance Method Summary collapse
-
#initialize(soap_principal) ⇒ CrowdUser
constructor
A new instance of CrowdUser.
-
#method_missing(attribute_name) ⇒ Object
allow attributes to be fetched by name.
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
#active ⇒ Object (readonly)
Returns the value of attribute active.
245 246 247 |
# File 'lib/crowd/crowd.rb', line 245 def active @active end |
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
246 247 248 |
# File 'lib/crowd/crowd.rb', line 246 def attributes @attributes end |
#conception ⇒ Object (readonly)
Returns the value of attribute conception.
247 248 249 |
# File 'lib/crowd/crowd.rb', line 247 def conception @conception end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
248 249 250 |
# File 'lib/crowd/crowd.rb', line 248 def description @description end |
#directory_id ⇒ Object (readonly)
Returns the value of attribute directory_id.
249 250 251 |
# File 'lib/crowd/crowd.rb', line 249 def directory_id @directory_id end |
#email ⇒ Object (readonly)
:nodoc:
254 255 256 |
# File 'lib/crowd/crowd.rb', line 254 def email @email end |
#first_name ⇒ Object (readonly)
:nodoc:
254 255 256 |
# File 'lib/crowd/crowd.rb', line 254 def first_name @first_name end |
#full_name ⇒ Object (readonly)
:nodoc:
254 255 256 |
# File 'lib/crowd/crowd.rb', line 254 def full_name @full_name end |
#last_modified ⇒ Object (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_name ⇒ Object (readonly)
:nodoc:
254 255 256 |
# File 'lib/crowd/crowd.rb', line 254 def last_name @last_name end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
251 252 253 |
# File 'lib/crowd/crowd.rb', line 251 def name @name end |
#user_id ⇒ Object (readonly)
Returns the value of attribute user_id.
244 245 246 |
# File 'lib/crowd/crowd.rb', line 244 def user_id @user_id end |