Class: LUSI::API::Person::UserAccount

Inherits:
Object
  • Object
show all
Defined in:
lib/lusi_api/person/student.rb

Overview

Represents a user’s network account in the LUSI API

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml = nil, lookup = nil, account_name: nil, identity: nil) ⇒ void

Initialises a new UserAccount instance

Parameters:

  • xml (Nokogiri::XML::Document, Nokogiri::XML::Node) (defaults to: nil)

    the parsed root of the user account

  • lookup (LUSI::API::Core::Lookup::LookupService, nil) (defaults to: nil)

    the lookup service for object resolution

  • account_name (String, nil) (defaults to: nil)

    the default account name

  • identity (String, nil) (defaults to: nil)

    the default student identity



413
414
415
416
# File 'lib/lusi_api/person/student.rb', line 413

def initialize(xml = nil, lookup = nil, account_name: nil, identity: nil)
  @account_name = LUSI::API::Core::XML.xml_content_at(xml, 'xmlns:AccountName', )
  @identity = LUSI::API::Core::XML.xml_content_at(xml, 'xmlns:Identity', identity)
end

Instance Attribute Details

#account_nameString?

Returns the account username.

Returns:

  • (String, nil)

    the account username



401
402
403
# File 'lib/lusi_api/person/student.rb', line 401

def 
  @account_name
end

#identityString?

Returns the student identity associated with the username.

Returns:

  • (String, nil)

    the student identity associated with the username



405
406
407
# File 'lib/lusi_api/person/student.rb', line 405

def identity
  @identity
end

Instance Method Details

#to_sString

Returns a string representation of the UserAccount instance

Returns:

  • (String)

    the string representation of the UserAccount instance



420
421
422
# File 'lib/lusi_api/person/student.rb', line 420

def to_s
  @account_name
end