Class: ActiveLrs::Xapi::SubStatement
- Inherits:
-
#StatementBase
- Object
- ActiveLrs::Xapi::SubStatement
- Defined in:
- lib/active_lrs/xapi/sub_statement.rb
Overview
Represents an xAPI SubStatement object.
A SubStatement is like a normal Statement but **cannot have its own id, authority, or stored information**. SubStatements are typically used as the object property inside another Statement or SubStatement.
Instance Attribute Summary collapse
-
#object_type ⇒ String
The object type.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ void
constructor
Initializes a new SubStatement.
-
#to_h ⇒ Hash{String => Object}
Converts the SubStatement into a hash suitable for inclusion as an object in another Statement.
Constructor Details
#initialize(attributes = {}) ⇒ void
Initializes a new SubStatement.
27 28 29 30 |
# File 'lib/active_lrs/xapi/sub_statement.rb', line 27 def initialize(attributes = {}) @object_type = "SubStatement" super(attributes) end |
Instance Attribute Details
#object_type ⇒ String
Returns The object type. MUST be the literal string ‘“SubStatement”`.
14 15 16 |
# File 'lib/active_lrs/xapi/sub_statement.rb', line 14 def object_type @object_type end |
Instance Method Details
#to_h ⇒ Hash{String => Object}
Converts the SubStatement into a hash suitable for inclusion as an object in another Statement.
49 50 51 52 53 |
# File 'lib/active_lrs/xapi/sub_statement.rb', line 49 def to_h node = super node["objectType"] = object_type node end |