Sha256: 246948fc671b1b7e3ee7d1a71f2c17ead86029cee80fd635057c7787ba87557b

Contents?: true

Size: 674 Bytes

Versions: 18

Compression:

Stored size: 674 Bytes

Contents

# frozen_string_literal: true

module WorkOS
  # The Event class provides a lightweight wrapper around
  # a WorkOS Event resource. This class is not meant to be instantiated
  # in user space, and is instantiated internally but exposed.
  class Event
    include HashProvider

    attr_accessor :id, :event, :data, :created_at

    def initialize(json)
      hash = JSON.parse(json, symbolize_names: true)

      @id = hash[:id]
      @event = hash[:event]
      @created_at = hash[:created_at]
      @data = hash[:data]
    end

    def to_json(*)
      {
        id: id,
        event: event,
        data: data,
        created_at: created_at,
      }
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
workos-5.9.0 lib/workos/event.rb
workos-5.8.0 lib/workos/event.rb
workos-5.7.0 lib/workos/event.rb
workos-5.6.0 lib/workos/event.rb
workos-5.5.1 lib/workos/event.rb
workos-5.5.0 lib/workos/event.rb
workos-5.4.0 lib/workos/event.rb
workos-5.3.0 lib/workos/event.rb
workos-5.2.1 lib/workos/event.rb
workos-5.2.0 lib/workos/event.rb
workos-5.1.0 lib/workos/event.rb
workos-5.0.0 lib/workos/event.rb
workos-4.8.0 lib/workos/event.rb
workos-4.5.0 lib/workos/event.rb
workos-4.4.0 lib/workos/event.rb
workos-4.3.0 lib/workos/event.rb
workos-4.2.1 lib/workos/event.rb
workos-4.2.0 lib/workos/event.rb