Class: Yoti::Sandbox::Profile::AgeVerificationBuilder
- Inherits:
-
Object
- Object
- Yoti::Sandbox::Profile::AgeVerificationBuilder
- Defined in:
- lib/yoti_sandbox/profile/age_verification.rb
Overview
Builder for AgeVerification
Instance Method Summary collapse
- #build ⇒ AgeVerification
-
#initialize ⇒ AgeVerificationBuilder
constructor
A new instance of AgeVerificationBuilder.
- #with_age_over(age) ⇒ self
- #with_age_under(age) ⇒ self
- #with_anchors(anchors) ⇒ self
- #with_date_of_birth(date_of_birth) ⇒ self
- #with_derivation(derivation) ⇒ self
Constructor Details
#initialize ⇒ AgeVerificationBuilder
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
#build ⇒ AgeVerification
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
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
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
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
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
73 74 75 76 |
# File 'lib/yoti_sandbox/profile/age_verification.rb', line 73 def with_derivation(derivation) @derivation = derivation self end |