Sha256: a790dafefb36fd7837514b25b1247e2c192df2595173cf347ea57dee5e7bc007
Contents?: true
Size: 1.57 KB
Versions: 47
Compression:
Stored size: 1.57 KB
Contents
module TestTrack::Identity extend ActiveSupport::Concern module ClassMethods def test_track_identifier(identifier_type, identifier_value_method) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize instance_methods = Module.new include instance_methods instance_methods.module_eval do define_method :test_track_identifier_type do identifier_type end define_method :test_track_identifier_value do send(identifier_value_method) end define_method :test_track_ab do |*args| locator = TestTrack::IdentitySessionLocator.new(self) locator.with_visitor do |v| v.ab(*args) end end define_method :test_track_vary do |*args, &block| locator = TestTrack::IdentitySessionLocator.new(self) locator.with_visitor do |v| v.vary(*args, &block) end end define_method :test_track_visitor_id do locator = TestTrack::IdentitySessionLocator.new(self) locator.with_visitor do |v| v.id end end define_method :test_track_sign_up! do locator = TestTrack::IdentitySessionLocator.new(self) locator.with_session do |session| session.sign_up! self end end define_method :test_track_log_in! do |opts = {}| locator = TestTrack::IdentitySessionLocator.new(self) locator.with_session do |session| session.log_in! self, opts end end end end end end
Version data entries
47 entries across 47 versions & 1 rubygems