Class: TermsOfUse::Decliner
- Inherits:
-
Object
- Object
- TermsOfUse::Decliner
- Includes:
- ActiveModel::Validations
- Defined in:
- app/services/terms_of_use/decliner.rb
Instance Attribute Summary collapse
-
#common_name ⇒ Object
readonly
Returns the value of attribute common_name.
-
#icn ⇒ Object
readonly
Returns the value of attribute icn.
-
#user_account ⇒ Object
readonly
Returns the value of attribute user_account.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(user_account:, common_name:, version:) ⇒ Decliner
constructor
A new instance of Decliner.
- #perform! ⇒ Object
Constructor Details
#initialize(user_account:, common_name:, version:) ⇒ Decliner
Returns a new instance of Decliner.
13 14 15 16 17 18 19 20 21 22 |
# File 'app/services/terms_of_use/decliner.rb', line 13 def initialize(user_account:, common_name:, version:) @user_account = user_account @icn = user_account&.icn @common_name = common_name @version = version validate! rescue ActiveModel::ValidationError => e log_and_raise_decliner_error(e) end |
Instance Attribute Details
#common_name ⇒ Object (readonly)
Returns the value of attribute common_name.
9 10 11 |
# File 'app/services/terms_of_use/decliner.rb', line 9 def common_name @common_name end |
#icn ⇒ Object (readonly)
Returns the value of attribute icn.
9 10 11 |
# File 'app/services/terms_of_use/decliner.rb', line 9 def icn @icn end |
#user_account ⇒ Object (readonly)
Returns the value of attribute user_account.
9 10 11 |
# File 'app/services/terms_of_use/decliner.rb', line 9 def user_account @user_account end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
9 10 11 |
# File 'app/services/terms_of_use/decliner.rb', line 9 def version @version end |
Instance Method Details
#perform! ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'app/services/terms_of_use/decliner.rb', line 24 def perform! terms_of_use_agreement.declined! update_sign_up_service Logger.new(terms_of_use_agreement:).perform terms_of_use_agreement rescue ActiveRecord::RecordInvalid => e log_and_raise_decliner_error(e) end |