Sha256: 0cb2a39b423755c767b6caf8f1629679ea96d90ab31eb38cede9ce5df0ef4b60

Contents?: true

Size: 800 Bytes

Versions: 13

Compression:

Stored size: 800 Bytes

Contents

module Analytical
  module Base
    module Api
      attr_reader :tracking_command_location, :parent, :options
      attr_accessor :commands

      def initialize(_parent, _options={})
        @parent = _parent
        @options = _options
        @tracking_command_location = :body_prepend
        @commands = []
      end

      def track(*args); ''; end
      def identify(id, *args); ''; end
      def event(name, *args); ''; end
      def init_javascript(location); {}; end

      def queue(*args)
        if args.first==:identify
          @commands.unshift args
        else
          @commands << args
        end
      end
      def process_queued_commands
        command_strings = @commands.collect {|c| send(*c) }
        @commands = []
        command_strings
      end

    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
analytical-0.16.0 lib/analytical/base.rb
analytical-0.15.0 lib/analytical/base.rb
analytical-0.14.0 lib/analytical/base.rb
analytical-0.13.0 lib/analytical/base.rb
analytical-0.12.0 lib/analytical/base.rb
analytical-0.11.0 lib/analytical/base.rb
analytical-0.10.0 lib/analytical/base.rb
analytical-0.9.0 lib/analytical/base.rb
analytical-0.8.0 lib/analytical/base.rb
analytical-0.7.0 lib/analytical/base.rb
analytical-0.6.0 lib/analytical/base.rb
analytical-0.5.0 lib/analytical/base.rb
analytical-0.3.0 lib/analytical/base.rb