Module: Wiselinks::Request
- Defined in:
- lib/wiselinks/request.rb
Class Method Summary collapse
Instance Method Summary collapse
- #referer_with_wiselinks ⇒ Object
- #referrer_with_wiselinks ⇒ Object
- #wiselinks? ⇒ Boolean
- #wiselinks_partial? ⇒ Boolean
- #wiselinks_template? ⇒ Boolean
Class Method Details
.included(base) ⇒ Object
3 4 5 6 |
# File 'lib/wiselinks/request.rb', line 3 def self.included(base) base.alias_method_chain :referer, :wiselinks base.alias_method_chain :referrer, :wiselinks end |
Instance Method Details
#referer_with_wiselinks ⇒ Object
8 9 10 |
# File 'lib/wiselinks/request.rb', line 8 def referer_with_wiselinks self.headers['X-Wiselinks-Referer'] || self.referer_without_wiselinks end |
#referrer_with_wiselinks ⇒ Object
12 13 14 |
# File 'lib/wiselinks/request.rb', line 12 def referrer_with_wiselinks self.referer_with_wiselinks end |
#wiselinks? ⇒ Boolean
16 17 18 |
# File 'lib/wiselinks/request.rb', line 16 def wiselinks? self.headers['X-Wiselinks'].present? end |
#wiselinks_partial? ⇒ Boolean
24 25 26 |
# File 'lib/wiselinks/request.rb', line 24 def wiselinks_partial? self.wiselinks? && self.headers['X-Wiselinks'] == 'partial' end |
#wiselinks_template? ⇒ Boolean
20 21 22 |
# File 'lib/wiselinks/request.rb', line 20 def wiselinks_template? self.wiselinks? && self.headers['X-Wiselinks'] != 'partial' end |