Passed
Push — master ( e9b4be...fdfd44 )
by Paul
01:35
created

EmploymentHistory.footer()   A

Complexity

Conditions 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
1 1
require_relative "entry/heading"
2 1
require_relative "entry/content"
3
4 1
module Resume
5 1
  module PDF
6 1
    module EmploymentHistory
7 1
      module_function
8
9 1
      def generate(pdf, employment_history)
10 1
        Entry::Heading.generate(pdf, employment_history[:heading])
11 1
        entries, bottom_padding, horizontal_rule_colour =
12
          employment_history[:content].values_at(
13
            :entries, :bottom_padding, :horizontal_rule_colour
14
          )
15 1
        generate_content(pdf, entries)
16 1
        footer(pdf, bottom_padding, horizontal_rule_colour)
17
      end
18
19 1
      def generate_content(pdf, entries)
20 1
        entries.values.each do |entry|
21 8
          Entry::Content.generate(pdf, entry)
22
        end
23
      end
24 1
      private_class_method :generate_content
25
26 1
      def footer(pdf, bottom_padding, horizontal_rule_colour)
27 1
        pdf.move_down(bottom_padding)
28 1
        pdf.stroke_horizontal_rule { color(horizontal_rule_colour) }
29
      end
30 1
      private_class_method :footer
31
    end
32
  end
33
end
34