Sha256: 14678b62fdb609ed951e2ed12ac730920ae44cb54eded3f5244898ce359971f8
Contents?: true
Size: 760 Bytes
Versions: 4
Compression:
Stored size: 760 Bytes
Contents
module MetryTags include Radiant::Taggable desc %{ All metry-related tags live inside this one. } tag "metry" do |tag| tag.globals.page.metry_active = true tag.locals.alternatives = {} tag.locals.event = tag.globals.page.request.env["metry.event"] tag.expand end desc %{ Wrap your control in this and nest your alternatives. } tag "metry:experiment" do |tag| control = tag.expand options = tag.locals.alternatives.merge("control" => control) Metry::Experiment.new(tag.attr["name"], tag.locals.event).choose(options, tag.attr["method"]) end desc %{ Alternatives go in here with a name. } tag "metry:experiment:alternative" do |tag| tag.locals.alternatives[tag.attr["name"]] = tag.expand '' end end
Version data entries
4 entries across 4 versions & 1 rubygems