activitypub-academy/app/lib/activity_log_event.rb
Sebastian Jambor 426e096a9b fix timestamp
2023-01-09 14:48:03 +01:00

18 lines
423 B
Ruby

# frozen_string_literal: true
class ActivityLogEvent
attr_accessor :type, :path, :data, :timestamp
def self.from_json_string(json_string)
json = Oj.load(json_string, mode: :strict)
ActivityLogEvent.new(json['type'], json['path'], json['data'])
end
def initialize(type, path, data, timestamp = Time.now.utc.iso8601)
@type = type
@path = path
@data = data
@timestamp = timestamp
end
end