Class: IMS::LTI::Models::Messages::ContentItemSelection
- Defined in:
- lib/ims/lti/models/messages/content_item_selection.rb
Constant Summary collapse
- MESSAGE_TYPE =
'ContentItemSelection'
Constants inherited from Message
Message::CUSTOM_PREFIX, Message::EXTENSION_PREFIX, Message::LAUNCH_TARGET_IFRAME, Message::LAUNCH_TARGET_WINDOW, Message::OAUTH_KEYS
Instance Attribute Summary
Attributes inherited from Message
#custom_params, #ext_params, #message_authenticator, #unknown_params
Instance Method Summary collapse
- #content_items=(ci) ⇒ Object
-
#initialize(attrs = {}) ⇒ ContentItemSelection
constructor
A new instance of ContentItemSelection.
- #parameters ⇒ Object
Methods inherited from Message
#add_custom_params, add_deprecated_params, add_optional_params, add_recommended_params, add_required_params, convert_param_values_to_crlf_endings, #deprecated_params, deprecated_params, descendants, generate, #get_custom_params, #get_ext_params, inherited, #jwt_params, #method_missing, #oauth_params, #optional_params, optional_params, parse_jwt, #post_params, recommended_params, #recommended_params, required_params, #required_params, #signed_post_params, #to_jwt
Constructor Details
#initialize(attrs = {}) ⇒ ContentItemSelection
Returns a new instance of ContentItemSelection.
7 8 9 10 |
# File 'lib/ims/lti/models/messages/content_item_selection.rb', line 7 def initialize(attrs = {}) super(attrs) self. = MESSAGE_TYPE end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class IMS::LTI::Models::Messages::Message
Instance Method Details
#content_items=(ci) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/ims/lti/models/messages/content_item_selection.rb', line 12 def content_items=(ci) if ci.instance_of? String container = IMS::LTI::Models::ContentItemContainer.from_json ci @content_items = container.graph else @content_items = ci end end |
#parameters ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/ims/lti/models/messages/content_item_selection.rb', line 21 def parameters if content_items params = self.class.send("parameters") params.delete('content_items') collect_attributes(params).merge({'content_items' => IMS::LTI::Models::ContentItemContainer.new(graph: content_items).to_json}) else super end end |