Class: BenefitsReceivedForm

Inherits:
BaseForm show all
Defined in:
app/forms/benefits_received_form.rb

Overview

A form object for the benefits received question.

Constant Summary collapse

VALID_BENEFITS =
[
  :jobseekers_allowance,
  :employment_support_allowance,
  :income_support,
  :universal_credit,
  :pension_credit,
  :scottish_legal_aid,
  :none,
  :dont_know
].freeze

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseForm

attribute?, #export, new_ignoring_extras, #type, #valid?

Class Method Details

.typeSymbol

The type of the form


23
24
25
# File 'app/forms/benefits_received_form.rb', line 23

def self.type
  :benefits_received
end

Instance Method Details

#benefitsArray<Symbol>


28
29
30
# File 'app/forms/benefits_received_form.rb', line 28

def benefits
  VALID_BENEFITS
end

#benefits_received=(v) ⇒ Object


32
33
34
# File 'app/forms/benefits_received_form.rb', line 32

def benefits_received=(v)
  super v.is_a?(Array) ? convert_benefits_array(v) : v
end