Class: Scorm::Metadata
- Inherits:
-
Hash
- Object
- Hash
- Scorm::Metadata
- Defined in:
- lib/scorm/metadata.rb
Overview
The Metadata
class holds meta data associated with a SCORM package in a hash like structure. The Metadata
class reads a LOM (Learning Object Metadata) structure and stores the data in categories. A Category
can contain any number of DataElements. A DataElement
behaves just like a string but can contain the same value in many different languages, accessed by the DataElement#value (or DataElement#to_s) method by specifying the language code as the first argument.
Ex.
<tt>pkg.manifest.metadata.general.class -> Metadata::Category</tt>
<tt>pkg.manifest.metadata.general.title.class -> Metadata::DataElement</tt>
<tt>pkg.manifest.metadata.general.title.value -> 'My course'</tt>
<tt>pkg.manifest.metadata.general.title.value('sv') -> 'Min kurs'</tt>
Defined Under Namespace
Classes: Category, DataElement
Class Method Summary collapse
Instance Method Summary collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(sym) ⇒ Object
29 30 31 |
# File 'lib/scorm/metadata.rb', line 29 def method_missing(sym) self.fetch(sym.to_s, nil) end |