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
- #populate_param_values(params) ⇒ Object
- #populate_service_values(service) ⇒ Object
- #populate_session_values(session) ⇒ Object
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
49 50 51 |
# File 'app/models/metadata_presenter/saved_form.rb', line 49 def attributes instance_values end |
#attributes=(hash) ⇒ Object
43 44 45 46 47 |
# File 'app/models/metadata_presenter/saved_form.rb', line 43 def attributes=(hash) hash.each do |key, value| send("#{key}=", value) end end |
#populate_param_values(params) ⇒ Object
27 28 29 30 31 32 |
# File 'app/models/metadata_presenter/saved_form.rb', line 27 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
39 40 41 |
# File 'app/models/metadata_presenter/saved_form.rb', line 39 def populate_service_values(service) self.service_version = service.version_id end |
#populate_session_values(session) ⇒ Object
34 35 36 37 |
# File 'app/models/metadata_presenter/saved_form.rb', line 34 def populate_session_values(session) self.user_id = session[:user_id] self.user_token = session[:user_token] end |