Class: HCA::UserAttributes
- Inherits:
-
Object
- Object
- HCA::UserAttributes
- Includes:
- ActiveModel::Model, ActiveModel::Validations
- Defined in:
- lib/hca/user_attributes.rb
Instance Attribute Summary collapse
-
#authn_context ⇒ Object
readonly
These attributes, along with uuid, are required by mpi/service.
-
#birth_date ⇒ Object
Returns the value of attribute birth_date.
-
#edipi ⇒ Object
readonly
These attributes, along with uuid, are required by mpi/service.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#gender ⇒ Object
Returns the value of attribute gender.
-
#idme_uuid ⇒ Object
readonly
These attributes, along with uuid, are required by mpi/service.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#logingov_uuid ⇒ Object
readonly
These attributes, along with uuid, are required by mpi/service.
-
#mhv_icn ⇒ Object
readonly
These attributes, along with uuid, are required by mpi/service.
-
#middle_name ⇒ Object
Returns the value of attribute middle_name.
-
#ssn ⇒ Object
Returns the value of attribute ssn.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ UserAttributes
constructor
A new instance of UserAttributes.
- #to_h ⇒ Object
- #uuid ⇒ Object
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_context ⇒ Object (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_date ⇒ Object
Returns the value of attribute birth_date.
13 14 15 |
# File 'lib/hca/user_attributes.rb', line 13 def birth_date @birth_date end |
#edipi ⇒ Object (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_name ⇒ Object
Returns the value of attribute first_name.
13 14 15 |
# File 'lib/hca/user_attributes.rb', line 13 def first_name @first_name end |
#gender ⇒ Object
Returns the value of attribute gender.
13 14 15 |
# File 'lib/hca/user_attributes.rb', line 13 def gender @gender end |
#idme_uuid ⇒ Object (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_name ⇒ Object
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_uuid ⇒ Object (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_icn ⇒ Object (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_name ⇒ Object
Returns the value of attribute middle_name.
13 14 15 |
# File 'lib/hca/user_attributes.rb', line 13 def middle_name @middle_name end |
#ssn ⇒ Object
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_h ⇒ Object
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 |
#uuid ⇒ Object
39 40 41 |
# File 'lib/hca/user_attributes.rb', line 39 def uuid SecureRandom.uuid end |