Sha256: af58fd2fef29a65b4e76146724200efbfcbac0ab7802752fe2e85302622fe6a0

Contents?: true

Size: 1.28 KB

Versions: 63

Compression:

Stored size: 1.28 KB

Contents

require 'coalescing_panda/engine' if defined?(Rails)
require 'jquery-rails'
require 'ims/lti'
require 'bearcat'
require 'oauth/request_proxy/rack_request'
require 'haml'
require 'sass-rails'
require 'coffee-rails'
require 'p3p'
require 'delayed_job_active_record'

module CoalescingPanda
  class LtiNavigationInUse < StandardError;end
  class NotMounted < StandardError;end

  @@lti_navigation = {}
  @@staged_navigation = {}
  @@lti_options = {}

  def self.lti_options= lti_options
    @@lti_options = lti_options
  end

  def self.lti_options
    @@lti_options.deep_dup
  end

  def self.register_navigation(navigation)
    @@lti_navigation[navigation] ||= {}
  end

  def self.stage_navigation(navigation, options)
    @@staged_navigation[navigation] = {} unless @@staged_navigation.has_key?(navigation)
    @@staged_navigation[navigation].merge!(options)
  end

  def self.lti_paths
    @@lti_navigation.deep_dup
  end

  def self.propagate_lti_navigation
    @@staged_navigation.each do |k,v|
      lti_navigation(k,v)
      @@staged_navigation.delete(k)
    end
  end

  private

  def self.lti_navigation(navigation, options)
    raise "lti navigation '#{navigation}' has not been registered!" unless @@lti_navigation.has_key?(navigation)
    @@lti_navigation[navigation].merge!(options)
  end

end

Version data entries

63 entries across 63 versions & 1 rubygems

Version Path
coalescing_panda-4.0.11 lib/coalescing_panda.rb
coalescing_panda-4.0.10 lib/coalescing_panda.rb
coalescing_panda-4.0.9 lib/coalescing_panda.rb
coalescing_panda-4.0.8 lib/coalescing_panda.rb
coalescing_panda-4.0.7 lib/coalescing_panda.rb
coalescing_panda-4.3.2 lib/coalescing_panda.rb
coalescing_panda-4.3.0 lib/coalescing_panda.rb
coalescing_panda-4.2.2 lib/coalescing_panda.rb
coalescing_panda-4.2.1 lib/coalescing_panda.rb
coalescing_panda-4.2.0 lib/coalescing_panda.rb
coalescing_panda-4.1.26 lib/coalescing_panda.rb
coalescing_panda-4.1.25 lib/coalescing_panda.rb
coalescing_panda-4.1.24 lib/coalescing_panda.rb
coalescing_panda-4.1.23 lib/coalescing_panda.rb
coalescing_panda-4.1.22 lib/coalescing_panda.rb
coalescing_panda-4.1.21 lib/coalescing_panda.rb
coalescing_panda-4.1.20 lib/coalescing_panda.rb
coalescing_panda-4.1.19 lib/coalescing_panda.rb
coalescing_panda-4.1.18 lib/coalescing_panda.rb
coalescing_panda-4.1.17 lib/coalescing_panda.rb