Class: TermsOfUse::Provisioner
- Inherits:
-
Object
- Object
- TermsOfUse::Provisioner
- Includes:
- ActiveModel::Validations
- Defined in:
- app/services/terms_of_use/provisioner.rb
Instance Attribute Summary collapse
-
#first_name ⇒ Object
readonly
Returns the value of attribute first_name.
-
#icn ⇒ Object
readonly
Returns the value of attribute icn.
-
#last_name ⇒ Object
readonly
Returns the value of attribute last_name.
-
#mpi_gcids ⇒ Object
readonly
Returns the value of attribute mpi_gcids.
Instance Method Summary collapse
-
#initialize(icn:, first_name:, last_name:, mpi_gcids:) ⇒ Provisioner
constructor
A new instance of Provisioner.
- #perform ⇒ Object
Constructor Details
#initialize(icn:, first_name:, last_name:, mpi_gcids:) ⇒ Provisioner
Returns a new instance of Provisioner.
13 14 15 16 17 18 19 20 21 22 23 |
# File 'app/services/terms_of_use/provisioner.rb', line 13 def initialize(icn:, first_name:, last_name:, mpi_gcids:) @icn = icn @first_name = first_name @last_name = last_name @mpi_gcids = mpi_gcids validate! rescue ActiveModel::ValidationError => e log_provisioner_error(e) raise Errors::ProvisionerError, e. end |
Instance Attribute Details
#first_name ⇒ Object (readonly)
Returns the value of attribute first_name.
9 10 11 |
# File 'app/services/terms_of_use/provisioner.rb', line 9 def first_name @first_name end |
#icn ⇒ Object (readonly)
Returns the value of attribute icn.
9 10 11 |
# File 'app/services/terms_of_use/provisioner.rb', line 9 def icn @icn end |
#last_name ⇒ Object (readonly)
Returns the value of attribute last_name.
9 10 11 |
# File 'app/services/terms_of_use/provisioner.rb', line 9 def last_name @last_name end |
#mpi_gcids ⇒ Object (readonly)
Returns the value of attribute mpi_gcids.
9 10 11 |
# File 'app/services/terms_of_use/provisioner.rb', line 9 def mpi_gcids @mpi_gcids end |
Instance Method Details
#perform ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'app/services/terms_of_use/provisioner.rb', line 25 def perform response = update_provisioning raise(Errors::ProvisionerError, 'Agreement not accepted') if response[:agreement_signed].blank? ActiveModel::Type::Boolean.new.cast(response[:agreement_signed]) rescue Common::Client::Errors::ClientError => e log_provisioner_error(e) raise Errors::ProvisionerError, e. end |