Class: LUSI::API::Person::LeaveDetails
- Inherits:
-
Object
- Object
- LUSI::API::Person::LeaveDetails
- Defined in:
- lib/lusi_api/person/student.rb
Overview
Represents a student’s leaving details in the LUSI API
Instance Attribute Summary collapse
-
#last_attend_date ⇒ DateTime?
The date of last attendance.
-
#leave_date ⇒ DateTime?
The date of leaving.
-
#leave_reason ⇒ LUSI::API::Core::Code?
The reason for leaving.
Instance Method Summary collapse
-
#initialize(xml = nil, lookup = nil, last_attend_date: nil, leave_date: nil, leave_reason: nil) ⇒ void
constructor
Initialises a new LeaveDetails instance.
-
#to_s ⇒ String
Returns a string representation of the LeaveDetails instance.
Constructor Details
#initialize(xml = nil, lookup = nil, last_attend_date: nil, leave_date: nil, leave_reason: nil) ⇒ void
Initialises a new LeaveDetails instance
37 38 39 40 41 |
# File 'lib/lusi_api/person/student.rb', line 37 def initialize(xml = nil, lookup = nil, last_attend_date: nil, leave_date: nil, leave_reason: nil) @leave_reason = LUSI::API::Core::Code.new(LUSI::API::Core::XML.xml_at(xml, 'xmlns:LeaveReason'), lookup) @leave_date = LUSI::API::Core::XML.xml_datetime_at(xml, 'xmlns:LeaveDate') @last_attend_date = LUSI::API::Core::XML.xml_datetime_at(xml, 'xmlns:LastAttendDate') end |
Instance Attribute Details
#last_attend_date ⇒ DateTime?
Returns the date of last attendance.
20 21 22 |
# File 'lib/lusi_api/person/student.rb', line 20 def last_attend_date @last_attend_date end |
#leave_date ⇒ DateTime?
Returns the date of leaving.
24 25 26 |
# File 'lib/lusi_api/person/student.rb', line 24 def leave_date @leave_date end |
#leave_reason ⇒ LUSI::API::Core::Code?
Returns the reason for leaving.
28 29 30 |
# File 'lib/lusi_api/person/student.rb', line 28 def leave_reason @leave_reason end |
Instance Method Details
#to_s ⇒ String
Returns a string representation of the LeaveDetails instance
45 46 47 |
# File 'lib/lusi_api/person/student.rb', line 45 def to_s @leave_reason.to_s end |