Sha256: 3bbf278df88060ff6e49871d88191e155b16c2eaf34bd3b6cb99f698314fb025

Contents?: true

Size: 623 Bytes

Versions: 17

Compression:

Stored size: 623 Bytes

Contents

module CobotClient
  module XdmHelper
    def self.included(base)
      if base.ancestors.include?(ActionController::Base)
        base.class_eval do
          before_filter :capture_xdm_params
          helper_method :xdm_params
        end
      end
    end

    def xdm_params
      session.to_hash.reduce({}) do |hash, element|
        if element.first.match(/xdm\_/)
          hash[element.first] = element.last
        end
        hash
      end
    end

    def capture_xdm_params
      params.each do |key, value|
        if key.match(/xdm\_/)
          session[key] = value
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
cobot_client-1.2.4 app/helpers/cobot_client/xdm_helper.rb
cobot_client-1.2.3 app/helpers/cobot_client/xdm_helper.rb
cobot_client-1.2.2 app/helpers/cobot_client/xdm_helper.rb
cobot_client-1.2.1 app/helpers/cobot_client/xdm_helper.rb
cobot_client-1.2.0 app/helpers/cobot_client/xdm_helper.rb
cobot_client-1.1.1 app/helpers/cobot_client/xdm_helper.rb
cobot_client-1.1.0 app/helpers/cobot_client/xdm_helper.rb
cobot_client-1.0.0 app/helpers/cobot_client/xdm_helper.rb
cobot_client-0.8.0 app/helpers/cobot_client/xdm_helper.rb
cobot_client-0.7.0 app/helpers/cobot_client/xdm_helper.rb
cobot_client-0.6.7 app/helpers/cobot_client/xdm_helper.rb
cobot_client-0.6.6 app/helpers/cobot_client/xdm_helper.rb
cobot_client-0.6.5 app/helpers/cobot_client/xdm_helper.rb
cobot_client-0.6.4 app/helpers/cobot_client/xdm_helper.rb
cobot_client-0.6.3 app/helpers/cobot_client/xdm_helper.rb
cobot_client-0.6.2 app/helpers/cobot_client/xdm_helper.rb
cobot_client-0.6.1 app/helpers/cobot_client/xdm_helper.rb