Sha256: 7758bd2fdfa87b892423d493031c6940f730b64c9cf77265f6a5dfef80a1abdd

Contents?: true

Size: 410 Bytes

Versions: 6

Compression:

Stored size: 410 Bytes

Contents

module GaEvents
  class Event < Struct.new(:category, :action, :label, :value)
    # Default values are set here, see README.md for details.
    def initialize(category = '-', action = '-', label = '-', value = 1)
      super
      GaEvents::List << self
    end

    def to_s
      [category, action, label, value].join('|')
    end

    def self.from_string(str)
      new(*str.split('|'))
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ga_events-1.3.1 lib/ga_events/event.rb
ga_events-1.3.0 lib/ga_events/event.rb
ga_events-1.2.0 lib/ga_events/event.rb
ga_events-1.1.0 lib/ga_events/event.rb
ga_events-1.0.1 lib/ga_events/event.rb
ga_events-1.0.0 lib/ga_events/event.rb