module PandaPal
Constants
- VERSION
Public Class Methods
Source
# File lib/panda_pal.rb, line 82 def self.extensions_for(type) (@@extensions[normalize_ext_type(type)] || []).uniq end
Source
# File lib/panda_pal.rb, line 49 def self.lti_custom_params @@lti_custom_params.deep_dup end
Source
# File lib/panda_pal.rb, line 45 def self.lti_custom_params=(custom_params) @@lti_custom_params = custom_params.with_indifferent_access end
Source
# File lib/panda_pal.rb, line 41 def self.lti_environments @@lti_environments.deep_dup end
Source
# File lib/panda_pal.rb, line 37 def self.lti_environments=(lti_environments) @@lti_environments = lti_environments end
Source
# File lib/panda_pal.rb, line 25 def self.lti_options @@lti_options.deep_dup end
Source
# File lib/panda_pal.rb, line 21 def self.lti_options= lti_options @@lti_options = lti_options end
Source
# File lib/panda_pal.rb, line 58 def self.lti_paths @@lti_navigation.deep_dup end
Source
# File lib/panda_pal.rb, line 62 def self.lti_private_key key = @@lti_private_key.presence key ||= ENV['LTI_PRIVATE_KEY'].presence key ||= File.read(File.join( File.dirname(__FILE__), "../config/dev_lti_key.key")) if Rails.env.development? return nil unless key.present? key = OpenSSL::PKey::RSA.new(key) if key.is_a?(String) key end
Source
# File lib/panda_pal.rb, line 72 def self.lti_private_key=(v) @@lti_private_key = k end
Source
# File lib/panda_pal.rb, line 33 def self.lti_properties @@lti_properties.deep_dup end
Source
# File lib/panda_pal.rb, line 29 def self.lti_properties= lti_properties @@lti_properties = lti_properties end
Source
# File lib/panda_pal.rb, line 94 def self.normalize_ext_type(type) type = type.to_s type = "#{self.to_s}::#{type}" unless type.start_with?('::') || type.start_with?(self.to_s) type end
Source
# File lib/panda_pal.rb, line 76 def self.register_extension(type, modul) type = normalize_ext_type(type) @@extensions[type] ||= [] @@extensions[type] << modul.to_s end
Source
# File lib/panda_pal.rb, line 86 def self.resolved_extensions_for(type) extensions_for(type).map do |ext| ext.safe_constantize end.compact end
Source
# File lib/panda_pal.rb, line 100 def self.validate_pandapal_config! errors = [] validate_lti_navigation(errors) if errors.present? lines = errors.map { |e| " - #{e}" } raise "PandaPal was not configured correctly:\n#{lines.join("\n")}" end end