Class: UserConsent::Agreement::FormObject

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model
Defined in:
app/models/user_consent/agreement/form_object.rb

Overview

Form object used for handling user consent

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#marketing_policyObject

Returns the value of attribute marketing_policy.



7
8
9
# File 'app/models/user_consent/agreement/form_object.rb', line 7

def marketing_policy
  @marketing_policy
end

#privacy_policyObject

Returns the value of attribute privacy_policy.



7
8
9
# File 'app/models/user_consent/agreement/form_object.rb', line 7

def privacy_policy
  @privacy_policy
end

Class Method Details

.model_nameActiveModel::Name

Defining this method allows us to use some ActiveModel patterns. For example, forms will be identified as sign_in instead of session_sign_in_form_object.

Returns:

  • (ActiveModel::Name)


28
29
30
# File 'app/models/user_consent/agreement/form_object.rb', line 28

def self.model_name
  ActiveModel::Name.new(self, nil, 'Agreement')
end

Instance Method Details

Method used to report user consent of the privacy policy and marketing

Options

marketing

Consent for marketing. Acceptable values are 0 [for NO] and 1 [for YES].

Parameters:

  • options (Hash) (defaults to: {})

    Optional. If not provided, marketing consent will default to NO [0].

Returns:

  • (Boolean)

    Whether or not the consent was successfully reported to ISACA



20
21
22
# File 'app/models/user_consent/agreement/form_object.rb', line 20

def report_consent(imis_id, options={})
  Isaca::Request::ReportConsent.get(imis_id, options).success? if valid?
end