Created
May 16, 2014 01:14
-
-
Save uglyog/df0665782137cdaa0772 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'securerandom' | |
class Event | |
attr_accessor :event_id, :timestamp, :host, :remote_address, :event_type, :user | |
def initialize | |
@event_id = SecureRandom.uuid | |
@timestamp = Time.now | |
end | |
def to_hash | |
{ | |
eventId: @event_id, | |
timestamp: @timestamp.gmtime, | |
host: @host, | |
remoteAddress: @remote_address, | |
eventType: @event_type, | |
user: @user | |
} | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment