Class: HCA::UserAttributes

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model, ActiveModel::Validations
Defined in:
lib/hca/user_attributes.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ UserAttributes

Returns a new instance of UserAttributes.



24
25
26
27
# File 'lib/hca/user_attributes.rb', line 24

def initialize(attributes = {})
  super
  @ssn = attributes[:ssn]&.gsub(/\D/, '')
end

Instance Attribute Details

#authn_contextObject (readonly)

These attributes, along with uuid, are required by mpi/service. They can be nil as they’re not part of the HCA form



22
23
24
# File 'lib/hca/user_attributes.rb', line 22

def authn_context
  @authn_context
end

#birth_dateObject

Returns the value of attribute birth_date.



13
14
15
# File 'lib/hca/user_attributes.rb', line 13

def birth_date
  @birth_date
end

#edipiObject (readonly)

These attributes, along with uuid, are required by mpi/service. They can be nil as they’re not part of the HCA form



22
23
24
# File 'lib/hca/user_attributes.rb', line 22

def edipi
  @edipi
end

#first_nameObject

Returns the value of attribute first_name.



13
14
15
# File 'lib/hca/user_attributes.rb', line 13

def first_name
  @first_name
end

#genderObject

Returns the value of attribute gender.



13
14
15
# File 'lib/hca/user_attributes.rb', line 13

def gender
  @gender
end

#idme_uuidObject (readonly)

These attributes, along with uuid, are required by mpi/service. They can be nil as they’re not part of the HCA form



22
23
24
# File 'lib/hca/user_attributes.rb', line 22

def idme_uuid
  @idme_uuid
end

#last_nameObject

Returns the value of attribute last_name.



13
14
15
# File 'lib/hca/user_attributes.rb', line 13

def last_name
  @last_name
end

#logingov_uuidObject (readonly)

These attributes, along with uuid, are required by mpi/service. They can be nil as they’re not part of the HCA form



22
23
24
# File 'lib/hca/user_attributes.rb', line 22

def logingov_uuid
  @logingov_uuid
end

#mhv_icnObject (readonly)

These attributes, along with uuid, are required by mpi/service. They can be nil as they’re not part of the HCA form



22
23
24
# File 'lib/hca/user_attributes.rb', line 22

def mhv_icn
  @mhv_icn
end

#middle_nameObject

Returns the value of attribute middle_name.



13
14
15
# File 'lib/hca/user_attributes.rb', line 13

def middle_name
  @middle_name
end

#ssnObject

Returns the value of attribute ssn.



13
14
15
# File 'lib/hca/user_attributes.rb', line 13

def ssn
  @ssn
end

Instance Method Details

#to_hObject



29
30
31
32
33
34
35
36
37
# File 'lib/hca/user_attributes.rb', line 29

def to_h
  {
    first_name:,
    middle_name:,
    last_name:,
    birth_date:,
    ssn:
  }
end

#uuidObject



39
40
41
# File 'lib/hca/user_attributes.rb', line 39

def uuid
  SecureRandom.uuid
end