Class: MetadataPresenter::SavedForm
- Inherits:
-
Object
- Object
- MetadataPresenter::SavedForm
- Includes:
- ActiveModel::Model, ActiveModel::Serializers::JSON
- Defined in:
- app/models/metadata_presenter/saved_form.rb
Instance Attribute Summary collapse
-
#active ⇒ Object
Returns the value of attribute active.
-
#attempts ⇒ Object
Returns the value of attribute attempts.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#email ⇒ Object
Returns the value of attribute email.
-
#id ⇒ Object
Returns the value of attribute id.
-
#page_slug ⇒ Object
Returns the value of attribute page_slug.
-
#secret_answer ⇒ Object
Returns the value of attribute secret_answer.
-
#secret_question ⇒ Object
Returns the value of attribute secret_question.
-
#secret_question_text ⇒ Object
Returns the value of attribute secret_question_text.
-
#service_slug ⇒ Object
Returns the value of attribute service_slug.
-
#service_version ⇒ Object
Returns the value of attribute service_version.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
-
#user_data_payload ⇒ Object
Returns the value of attribute user_data_payload.
-
#user_id ⇒ Object
Returns the value of attribute user_id.
-
#user_token ⇒ Object
Returns the value of attribute user_token.
Instance Method Summary collapse
- #attributes ⇒ Object
- #attributes=(hash) ⇒ Object
-
#initialize ⇒ SavedForm
constructor
A new instance of SavedForm.
- #populate_param_values(params) ⇒ Object
- #populate_service_values(service) ⇒ Object
- #populate_session_values(session) ⇒ Object
Constructor Details
#initialize ⇒ SavedForm
Returns a new instance of SavedForm.
26 |
# File 'app/models/metadata_presenter/saved_form.rb', line 26 def initialize; end |
Instance Attribute Details
#active ⇒ Object
Returns the value of attribute active.
8 9 10 |
# File 'app/models/metadata_presenter/saved_form.rb', line 8 def active @active end |
#attempts ⇒ Object
Returns the value of attribute attempts.
8 9 10 |
# File 'app/models/metadata_presenter/saved_form.rb', line 8 def attempts @attempts end |
#created_at ⇒ Object
Returns the value of attribute created_at.
8 9 10 |
# File 'app/models/metadata_presenter/saved_form.rb', line 8 def created_at @created_at end |
#email ⇒ Object
Returns the value of attribute email.
8 9 10 |
# File 'app/models/metadata_presenter/saved_form.rb', line 8 def email @email end |
#id ⇒ Object
Returns the value of attribute id.
8 9 10 |
# File 'app/models/metadata_presenter/saved_form.rb', line 8 def id @id end |
#page_slug ⇒ Object
Returns the value of attribute page_slug.
8 9 10 |
# File 'app/models/metadata_presenter/saved_form.rb', line 8 def page_slug @page_slug end |
#secret_answer ⇒ Object
Returns the value of attribute secret_answer.
8 9 10 |
# File 'app/models/metadata_presenter/saved_form.rb', line 8 def secret_answer @secret_answer end |
#secret_question ⇒ Object
Returns the value of attribute secret_question.
8 9 10 |
# File 'app/models/metadata_presenter/saved_form.rb', line 8 def secret_question @secret_question end |
#secret_question_text ⇒ Object
Returns the value of attribute secret_question_text.
8 9 10 |
# File 'app/models/metadata_presenter/saved_form.rb', line 8 def secret_question_text @secret_question_text end |
#service_slug ⇒ Object
Returns the value of attribute service_slug.
8 9 10 |
# File 'app/models/metadata_presenter/saved_form.rb', line 8 def service_slug @service_slug end |
#service_version ⇒ Object
Returns the value of attribute service_version.
8 9 10 |
# File 'app/models/metadata_presenter/saved_form.rb', line 8 def service_version @service_version end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
8 9 10 |
# File 'app/models/metadata_presenter/saved_form.rb', line 8 def updated_at @updated_at end |
#user_data_payload ⇒ Object
Returns the value of attribute user_data_payload.
8 9 10 |
# File 'app/models/metadata_presenter/saved_form.rb', line 8 def user_data_payload @user_data_payload end |
#user_id ⇒ Object
Returns the value of attribute user_id.
8 9 10 |
# File 'app/models/metadata_presenter/saved_form.rb', line 8 def user_id @user_id end |
#user_token ⇒ Object
Returns the value of attribute user_token.
8 9 10 |
# File 'app/models/metadata_presenter/saved_form.rb', line 8 def user_token @user_token end |
Instance Method Details
#attributes ⇒ Object
51 52 53 |
# File 'app/models/metadata_presenter/saved_form.rb', line 51 def attributes instance_values end |
#attributes=(hash) ⇒ Object
45 46 47 48 49 |
# File 'app/models/metadata_presenter/saved_form.rb', line 45 def attributes=(hash) hash.each do |key, value| send("#{key}=", value) end end |
#populate_param_values(params) ⇒ Object
28 29 30 31 32 33 |
# File 'app/models/metadata_presenter/saved_form.rb', line 28 def populate_param_values(params) self.email = params['email'] self.page_slug = params['saved_form']['page_slug'] self.secret_question = params['saved_form']['secret_question'] self.secret_answer = params['secret_answer'] end |
#populate_service_values(service) ⇒ Object
40 41 42 43 |
# File 'app/models/metadata_presenter/saved_form.rb', line 40 def populate_service_values(service) self.service_slug = service.service_slug self.service_version = service.version_id end |
#populate_session_values(session) ⇒ Object
35 36 37 38 |
# File 'app/models/metadata_presenter/saved_form.rb', line 35 def populate_session_values(session) self.user_id = session[:user_id] self.user_token = session[:user_token] end |