Class: BGS::Children

Inherits:
Object
  • Object
show all
Defined in:
lib/bgs/children.rb

Instance Method Summary collapse

Constructor Details

#initialize(proc_id:, payload:, user:) ⇒ Children

Returns a new instance of Children.



7
8
9
10
11
12
13
14
# File 'lib/bgs/children.rb', line 7

def initialize(proc_id:, payload:, user:)
  @user = user
  @children = []
  @step_children = []
  @proc_id = proc_id
  @views = payload['view:selectable686_options']
  @dependents_application = payload['dependents_application']
end

Instance Method Details

#create_allObject



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/bgs/children.rb', line 16

def create_all
  report_children if @views['add_child']
  report_stepchildren if @views['report_stepchild_not_in_household']
  report_child_event('child_marriage') if @views['report_marriage_of_child_under18']
  report_child_event('not_attending_school') if @views['report_child18_or_older_is_not_attending_school']

  {
    dependents: @children,
    step_children: @step_children
  }
end