Class: LtiXml::BasePlatform

Inherits:
Object
  • Object
show all
Defined in:
app/lib/lti_xml/base_platform.rb

Direct Known Subclasses

BridgePlatform, CanvasPlatform

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(platform, full_request_url, main_app) ⇒ BasePlatform

Returns a new instance of BasePlatform.



5
6
7
8
9
# File 'app/lib/lti_xml/base_platform.rb', line 5

def initialize(platform, full_request_url, main_app)
  @platform = platform
  @parsed_request_url = URI.parse(full_request_url)
  @main_app = main_app
end

Instance Attribute Details

#main_appObject

Returns the value of attribute main_app.



3
4
5
# File 'app/lib/lti_xml/base_platform.rb', line 3

def main_app
  @main_app
end

#parsed_request_urlObject

Returns the value of attribute parsed_request_url.



3
4
5
# File 'app/lib/lti_xml/base_platform.rb', line 3

def parsed_request_url
  @parsed_request_url
end

#platformObject

Returns the value of attribute platform.



3
4
5
# File 'app/lib/lti_xml/base_platform.rb', line 3

def platform
  @platform
end

Instance Method Details

#xmlObject

Override one of the following formatter methods in your individual platform class, or if you must, you can override the whole xml method and do it all custom.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'app/lib/lti_xml/base_platform.rb', line 13

def xml
  ims_tool_config
  add_domain
  add_privacy_level
  add_lti_properties
  add_lti_custom_params
  add_lti_options
  add_lti_nav
  add_environments

  #strip the launch url
  xml = @tc.to_xml
  xml = xml.sub(/<blti:launch_url>.*<\/blti:launch_url>/, '') if PandaPal.lti_options[:launch_url] === false

  return xml
end