Sha256: 1df8d60ffdc1cce087c815187257c85d8e3eae33f64ff20254be2e86d0e8a199

Contents?: true

Size: 965 Bytes

Versions: 13

Compression:

Stored size: 965 Bytes

Contents

# frozen_string_literal: true

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

    attr_accessor :id, :user_id, :email,
                  :expires_at, :code, :created_at, :updated_at

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

      @id = hash[:id]
      @user_id = hash[:user_id]
      @email = hash[:email]
      @code = hash[:code]
      @expires_at = hash[:expires_at]
      @created_at = hash[:created_at]
      @updated_at = hash[:updated_at]
    end

    def to_json(*)
      {
        id: id,
        user_id: user_id,
        email: email,
        code: code,
        expires_at: expires_at,
        created_at: created_at,
        updated_at: updated_at,
      }
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
workos-5.9.0 lib/workos/email_verification.rb
workos-5.8.0 lib/workos/email_verification.rb
workos-5.7.0 lib/workos/email_verification.rb
workos-5.6.0 lib/workos/email_verification.rb
workos-5.5.1 lib/workos/email_verification.rb
workos-5.5.0 lib/workos/email_verification.rb
workos-5.4.0 lib/workos/email_verification.rb
workos-5.3.0 lib/workos/email_verification.rb
workos-5.2.1 lib/workos/email_verification.rb
workos-5.2.0 lib/workos/email_verification.rb
workos-5.1.0 lib/workos/email_verification.rb
workos-5.0.0 lib/workos/email_verification.rb
workos-4.8.0 lib/workos/email_verification.rb