Class: Yoti::Sandbox::Profile::AgeVerification

Inherits:
Object
  • Object
show all
Defined in:
lib/yoti_sandbox/profile/age_verification.rb

Overview

Represents an Age Verification attribute that can be used by the profile sandbox service

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(date_of_birth:, derivation:, anchors: []) ⇒ self

Parameters:

  • date_of_birth (DateTime|Time)
  • derivation (String)
  • anchors (Array<Anchor>) (defaults to: [])


18
19
20
21
22
23
24
25
26
# File 'lib/yoti_sandbox/profile/age_verification.rb', line 18

def initialize(
  date_of_birth:,
  derivation:,
  anchors: []
)
  @date_of_birth = date_of_birth
  @derivation = derivation
  @anchors = anchors
end

Class Method Details

.builderAgeVerificationBuilder



31
32
33
# File 'lib/yoti_sandbox/profile/age_verification.rb', line 31

def self.builder
  AgeVerificationBuilder.new
end

Instance Method Details

#to_attributeAttribute

Returns:



38
39
40
41
42
43
44
45
# File 'lib/yoti_sandbox/profile/age_verification.rb', line 38

def to_attribute
  Attribute.new(
    name: Yoti::Attribute::DATE_OF_BIRTH,
    value: @date_of_birth.strftime('%F'),
    derivation: @derivation,
    anchors: @anchors
  )
end