Class: Yoti::Sandbox::Profile::AttributeIssuanceDetailsBuilder

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

Overview

Builder for AttributeIssuanceDetails

Instance Method Summary collapse

Constructor Details

#initializeAttributeIssuanceDetailsBuilder

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

#buildAttributeIssuanceDetails



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

Parameters:

  • definition (String)

Returns:

  • (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

Parameters:

  • expiry_date (Time, DateTime)

Returns:

  • (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

Parameters:

  • issuance_token (String)

Returns:

  • (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