Class: Consently::Providers::Custom

Inherits:
Base
  • Object
show all
Defined in:
lib/consently/providers/custom.rb

Overview

The escape hatch for a vendor Consently does not know about yet. Blocked and released exactly like a built-in one.

c.tag :custom, as: :piwik, category: :analytics,
    src: "https://cdn.example.com/piwik.js"

c.tag :custom, as: :whatever, category: :marketing, inline: <<~JS
console.log("hello");
JS

Constant Summary

Constants inherited from Base

Base::SAFE_OPTION

Instance Attribute Summary

Attributes inherited from Base

#category, #key, #options

Instance Method Summary collapse

Methods inherited from Base

build, cookie, cookie_manifest, #cookies, google?, #google?, #initialize, provider_key, provider_key=, register, registry, #to_s

Constructor Details

This class inherits a constructor from Consently::Providers::Base

Instance Method Details

#noscriptObject



20
21
22
# File 'lib/consently/providers/custom.rb', line 20

def noscript
  options[:noscript]
end

#scriptsObject



16
17
18
# File 'lib/consently/providers/custom.rb', line 16

def scripts
  [ Script.new(src: options[:src], inline: options[:inline], async: options.fetch(:async, true), data: options[:data]) ]
end