Class: Yoti::Sandbox::Profile::AgeVerificationBuilder

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

Overview

Builder for AgeVerification

Instance Method Summary collapse

Constructor Details

#initializeAgeVerificationBuilder

Returns a new instance of AgeVerificationBuilder.



52
53
54
55
56
# File 'lib/yoti_sandbox/profile/age_verification.rb', line 52

def initialize
  @date_of_birth = nil
  @derivation = nil
  @anchors = []
end

Instance Method Details

#buildAgeVerification

Returns:



109
110
111
112
113
114
115
# File 'lib/yoti_sandbox/profile/age_verification.rb', line 109

def build
  AgeVerification.new(
    date_of_birth: @date_of_birth,
    derivation: @derivation,
    anchors: @anchors
  )
end

#with_age_over(age) ⇒ self

Parameters:

  • age (Integer)

Returns:

  • (self)


83
84
85
# File 'lib/yoti_sandbox/profile/age_verification.rb', line 83

def with_age_over(age)
  with_derivation("#{Yoti::Attribute::AGE_OVER}#{age}")
end

#with_age_under(age) ⇒ self

Parameters:

  • age (Integer)

Returns:

  • (self)


92
93
94
# File 'lib/yoti_sandbox/profile/age_verification.rb', line 92

def with_age_under(age)
  with_derivation("#{Yoti::Attribute::AGE_UNDER}#{age}")
end

#with_anchors(anchors) ⇒ self

Parameters:

Returns:

  • (self)


101
102
103
104
# File 'lib/yoti_sandbox/profile/age_verification.rb', line 101

def with_anchors(anchors)
  @anchors = anchors
  self
end

#with_date_of_birth(date_of_birth) ⇒ self

Parameters:

  • date_of_birth (DateTime|Time)

Returns:

  • (self)


63
64
65
66
# File 'lib/yoti_sandbox/profile/age_verification.rb', line 63

def with_date_of_birth(date_of_birth)
  @date_of_birth = date_of_birth
  self
end

#with_derivation(derivation) ⇒ self

Parameters:

  • derivation (String)

Returns:

  • (self)


73
74
75
76
# File 'lib/yoti_sandbox/profile/age_verification.rb', line 73

def with_derivation(derivation)
  @derivation = derivation
  self
end