Class: Yoti::Sandbox::Profile::AttributeIssuanceDetailsBuilder
- Inherits:
-
Object
- Object
- Yoti::Sandbox::Profile::AttributeIssuanceDetailsBuilder
- Defined in:
- lib/yoti_sandbox/profile/third_party.rb
Overview
Builder for AttributeIssuanceDetails
Instance Method Summary collapse
- #build ⇒ AttributeIssuanceDetails
-
#initialize ⇒ AttributeIssuanceDetailsBuilder
constructor
A new instance of AttributeIssuanceDetailsBuilder.
- #with_definition(definition) ⇒ self
- #with_expiry_date(expiry_date) ⇒ self
- #with_issuance_token(issuance_token) ⇒ self
Constructor Details
#initialize ⇒ AttributeIssuanceDetailsBuilder
Returns a new instance of AttributeIssuanceDetailsBuilder.
32 33 34 |
# File 'lib/yoti_sandbox/profile/third_party.rb', line 32 def initialize @definitions = [] end |
Instance Method Details
#build ⇒ AttributeIssuanceDetails
71 72 73 74 75 |
# File 'lib/yoti_sandbox/profile/third_party.rb', line 71 def build issuing_attributes = IssuingAttributes.new(@expiry_date, @definitions) value = AttributeIssuanceDetailsValue.new(@issuance_token, issuing_attributes) AttributeIssuanceDetails.new(value) end |
#with_definition(definition) ⇒ self
63 64 65 66 |
# File 'lib/yoti_sandbox/profile/third_party.rb', line 63 def with_definition(definition) @definitions << AttributeDefinition.new(definition) self end |
#with_expiry_date(expiry_date) ⇒ self
52 53 54 55 56 |
# File 'lib/yoti_sandbox/profile/third_party.rb', line 52 def with_expiry_date(expiry_date) Validation.assert_respond_to(:to_time, expiry_date, 'expiry_date') @expiry_date = expiry_date self end |
#with_issuance_token(issuance_token) ⇒ self
41 42 43 44 45 |
# File 'lib/yoti_sandbox/profile/third_party.rb', line 41 def with_issuance_token(issuance_token) Validation.assert_is_a(String, issuance_token, 'issuance_token') @issuance_token = issuance_token self end |