Class: Renalware::Forms::Generic::Homecare::V1::DeliveryFrequencies

Inherits:
Base
  • Object
show all
Defined in:
lib/renalware/forms/generic/homecare/v1/delivery_frequencies.rb

Constant Summary

Constants inherited from Base

Base::TABLE_WIDTH

Constants inherited from Base

Base::CHECKBOX, Base::EMPTY_CHECKBOX

Instance Method Summary collapse

Methods inherited from Base

#heading, #table_styles

Methods inherited from Base

#borderless_table_style, #cell_with_leading_checkbox, #cell_with_trailing_checkbox, #underlined_table_style

Instance Method Details

#buildObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/renalware/forms/generic/homecare/v1/delivery_frequencies.rb', line 6

def build
  font_size 10
  move_down 10
  row = [heading("Frequency of deliveries:")]
  args.delivery_frequencies.each do |freq|
    checked = freq == args.selected_delivery_frequency
    row.concat << cell_with_leading_checkbox(freq, checked: checked)
  end

  table(
    [row],
    **table_styles(border_width: 0, padding: [1, 30, 1, 0]),
    column_widths: { 0 => 150 }
  )
end