Class: Qti::Exporter
- Inherits:
-
Object
- Object
- Qti::Exporter
- Defined in:
- lib/qti/exporter.rb
Instance Attribute Summary collapse
-
#assessment_test ⇒ Object
readonly
Returns the value of attribute assessment_test.
-
#exported_file_path ⇒ Object
readonly
Returns the value of attribute exported_file_path.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#package_root_path ⇒ Object
readonly
Returns the value of attribute package_root_path.
Instance Method Summary collapse
- #export ⇒ Object
-
#initialize(assessment_test, args = {}) ⇒ Exporter
constructor
A new instance of Exporter.
Constructor Details
#initialize(assessment_test, args = {}) ⇒ Exporter
Returns a new instance of Exporter.
5 6 7 8 9 10 11 |
# File 'lib/qti/exporter.rb', line 5 def initialize(assessment_test, args = {}) @logger = args[:logger] || NullLogger.new @assessment_test = assessment_test @package_root_path = args[:package_root_path] || '.' @exported_file_path = "#{File.join(File.('..', package_root_path), File.basename(export_file_name))}.zip" end |
Instance Attribute Details
#assessment_test ⇒ Object (readonly)
Returns the value of attribute assessment_test.
3 4 5 |
# File 'lib/qti/exporter.rb', line 3 def assessment_test @assessment_test end |
#exported_file_path ⇒ Object (readonly)
Returns the value of attribute exported_file_path.
3 4 5 |
# File 'lib/qti/exporter.rb', line 3 def exported_file_path @exported_file_path end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
3 4 5 |
# File 'lib/qti/exporter.rb', line 3 def logger @logger end |
#package_root_path ⇒ Object (readonly)
Returns the value of attribute package_root_path.
3 4 5 |
# File 'lib/qti/exporter.rb', line 3 def package_root_path @package_root_path end |
Instance Method Details
#export ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/qti/exporter.rb', line 13 def export Dir.mkdir(package_root_path) unless File.exist?(package_root_path) create_assessment_xml create_imsmanifest_xml export_items compress_package end |