class WebAuthn::PublicKeyCredential::Entity

Attributes

name[R]

Public Class Methods

new(name:) click to toggle source
# File lib/webauthn/public_key_credential/entity.rb, line 10
def initialize(name:)
  @name = name
end

Public Instance Methods

as_json() click to toggle source
# File lib/webauthn/public_key_credential/entity.rb, line 14
def as_json
  to_hash.to_camelback_keys
end

Private Instance Methods

attributes() click to toggle source
# File lib/webauthn/public_key_credential/entity.rb, line 38
def attributes
  [:name]
end
to_hash() click to toggle source
# File lib/webauthn/public_key_credential/entity.rb, line 20
def to_hash
  hash = {}

  attributes.each do |attribute_name|
    value = send(attribute_name)

    if value.respond_to?(:as_json)
      value = value.as_json
    end

    if value
      hash[attribute_name] = value
    end
  end

  hash
end