Sha256: 1d2c1006ad120acff03e06a5e2f588cede89723a22cde471b96eed070634a9de

Contents?: true

Size: 433 Bytes

Versions: 7

Compression:

Stored size: 433 Bytes

Contents

require 'hallmonitor/monitored'
module Hallmonitor
  ##
  # The event class is a single-fire event
  class Event
    include Hallmonitor::Monitored
    
    attr_accessor :name, :time, :count
    
    def initialize(name, count=1)
      @name = name
      @time = Time.now
      @count = count
    end

    def to_json(*a)
      {
        name: @name,
        time: @time,
        count: @count
      }.to_json(*a)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
hallmonitor-0.4.0 lib/hallmonitor/event.rb
hallmonitor-0.3.0 lib/hallmonitor/event.rb
hallmonitor-0.2.0 lib/hallmonitor/event.rb
hallmonitor-0.1.1 lib/hallmonitor/event.rb
hallmonitor-0.1.0 lib/hallmonitor/event.rb
hallmonitor-0.0.2 lib/hallmonitor/event.rb
hallmonitor-0.0.1 lib/hallmonitor/event.rb