Sha256: 3404e6a278cead29d3a631702ecae7b459bc5bec0c2b044422fefc22b8f553e1

Contents?: true

Size: 651 Bytes

Versions: 12

Compression:

Stored size: 651 Bytes

Contents

module Wiselinks
  module Request
    def self.included(base)
      base.alias_method_chain :referer, :wiselinks
      base.alias_method_chain :referrer, :wiselinks
    end

    def referer_with_wiselinks
      self.headers['X-Wiselinks-Referer'] || self.referer_without_wiselinks
    end

    def referrer_with_wiselinks
      self.referer_with_wiselinks
    end

    def wiselinks?
      self.headers['X-Wiselinks'].present?
    end

    def wiselinks_template?
      self.wiselinks? && self.headers['X-Wiselinks'] != 'partial'
    end

    def wiselinks_partial?
      self.wiselinks? && self.headers['X-Wiselinks'] == 'partial'
    end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
wiselinks-artirix-1.3.0 lib/wiselinks/request.rb
wiselinks-1.2.1 lib/wiselinks/request.rb
wiselinks-1.2.0 lib/wiselinks/request.rb
wiselinks-1.1.4 lib/wiselinks/request.rb
wiselinks-1.1.2 lib/wiselinks/request.rb
wiselinks-1.1.1 lib/wiselinks/request.rb
wiselinks-1.1.0 lib/wiselinks/request.rb
wiselinks-1.0.0 lib/wiselinks/request.rb
wiselinks-0.7.3 lib/wiselinks/request.rb
wiselinks-0.7.2 lib/wiselinks/request.rb
wiselinks-0.7.1 lib/wiselinks/request.rb
wiselinks-0.7.0 lib/wiselinks/request.rb