Class: IMS::LTI::Models::ToolConsumerProfile

Inherits:
LTIModel
  • Object
show all
Defined in:
lib/ims/lti/models/tool_consumer_profile.rb

Constant Summary collapse

CONTEXT =
"http://purl.imsglobal.org/ctx/lti/v2/ToolConsumerProfile"
TYPE =
"ToolConsumerProfile"
MESSAGING_CAPABILITIES =
%w(basic-lti-launch-request)
OUTCOMES_CAPABILITIES =
%w(Result.autocreate)

Constants inherited from LTIModel

LTIModel::LTI_VERSION_2P0, LTIModel::LTI_VERSION_2P1

Instance Method Summary collapse

Methods inherited from LTIModel

add_attribute, add_attributes, #as_json, #attributes, #attributes=, from_json, #from_json, inherit_attributes, inherited, #method_missing, #to_json

Constructor Details

#initialize(attr = {}) ⇒ ToolConsumerProfile

Returns a new instance of ToolConsumerProfile.



18
19
20
21
22
# File 'lib/ims/lti/models/tool_consumer_profile.rb', line 18

def initialize(attr = {})
  @context = [CONTEXT]
  @type = TYPE
  super(attr)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class IMS::LTI::Models::LTIModel

Instance Method Details

#capabilities_offeredObject



28
29
30
# File 'lib/ims/lti/models/tool_consumer_profile.rb', line 28

def capabilities_offered
  [*@capability_offered]
end

#reregistration_capable?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/ims/lti/models/tool_consumer_profile.rb', line 36

def reregistration_capable?
  @capability_offered.include?(Messages::ToolProxyUpdateRequest::MESSAGE_TYPE)
end

#security_profile_by_name(security_profile_name:) ⇒ Object



40
41
42
# File 'lib/ims/lti/models/tool_consumer_profile.rb', line 40

def security_profile_by_name(security_profile_name:)
  security_profiles.find { |sp| sp.security_profile_name == security_profile_name}
end

#security_profilesObject



32
33
34
# File 'lib/ims/lti/models/tool_consumer_profile.rb', line 32

def security_profiles
  [*@security_profile]
end

#services_offeredObject



24
25
26
# File 'lib/ims/lti/models/tool_consumer_profile.rb', line 24

def services_offered
  [*@service_offered]
end