Class: LUSI::API::Course::CourseDocument
- Inherits:
-
Object
- Object
- LUSI::API::Course::CourseDocument
- Defined in:
- lib/lusi_api/course.rb
Overview
Represents a course document in the LUSI API
Instance Attribute Summary collapse
-
#html_text ⇒ String?
The text document as pre-formatted HTML.
-
#type ⇒ LUSI::API::Core::Code?
The course document type.
Instance Method Summary collapse
-
#initialize(xml = nil, lookup = nil, type: nil, html_text: nil) ⇒ void
constructor
Initialises a new CourseDocument instance.
-
#to_s ⇒ String
Returns a string representation of the CourseDocument instance.
Constructor Details
#initialize(xml = nil, lookup = nil, type: nil, html_text: nil) ⇒ void
Initialises a new CourseDocument instance
560 561 562 563 |
# File 'lib/lusi_api/course.rb', line 560 def initialize(xml = nil, lookup = nil, type: nil, html_text: nil) @type = LUSI::API::Core::Code.new(LUSI::API::Core::XML.xml_at(xml, 'xmlns:Type', type), lookup) @html_text = LUSI::API::Core::XML.xml_content_at(xml, 'xmlns:HTMLText', html_text) end |
Instance Attribute Details
#html_text ⇒ String?
Returns the text document as pre-formatted HTML.
552 553 554 |
# File 'lib/lusi_api/course.rb', line 552 def html_text @html_text end |
#type ⇒ LUSI::API::Core::Code?
Returns the course document type.
548 549 550 |
# File 'lib/lusi_api/course.rb', line 548 def type @type end |
Instance Method Details
#to_s ⇒ String
Returns a string representation of the CourseDocument instance
567 568 569 |
# File 'lib/lusi_api/course.rb', line 567 def to_s @type.description end |