Class: MetadataPresenter::SavedForm

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model, ActiveModel::Serializers::JSON
Defined in:
app/models/metadata_presenter/saved_form.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSavedForm

Returns a new instance of SavedForm.



26
# File 'app/models/metadata_presenter/saved_form.rb', line 26

def initialize; end

Instance Attribute Details

#activeObject

Returns the value of attribute active.



8
9
10
# File 'app/models/metadata_presenter/saved_form.rb', line 8

def active
  @active
end

#attemptsObject

Returns the value of attribute attempts.



8
9
10
# File 'app/models/metadata_presenter/saved_form.rb', line 8

def attempts
  @attempts
end

#created_atObject

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

#emailObject

Returns the value of attribute email.



8
9
10
# File 'app/models/metadata_presenter/saved_form.rb', line 8

def email
  @email
end

#idObject

Returns the value of attribute id.



8
9
10
# File 'app/models/metadata_presenter/saved_form.rb', line 8

def id
  @id
end

#page_slugObject

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_answerObject

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_questionObject

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_textObject

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_slugObject

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_versionObject

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_atObject

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_payloadObject

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_idObject

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_tokenObject

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

#attributesObject



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