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

TechnicalSkills.generate_table()   A

Complexity

Conditions 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
dl 0
loc 5
ccs 4
cts 4
cp 1
crap 1
rs 9.4285
c 1
b 0
f 0
1 1
require_relative "entry/heading"
2
3 1
module Resume
4 1
  module PDF
5 1
    module TechnicalSkills
6 1
      module_function
7
8 1
      def generate(pdf, technical_skills)
9 1
        heading, content = technical_skills.values_at(:heading, :content)
10 1
        Entry::Heading.generate(pdf, heading)
11 1
        generate_table(pdf, content)
12
      end
13
14 1
      def generate_table(pdf, content)
15 1
        top_padding, properties = content.values_at(:top_padding, :properties)
16 1
        pdf.move_down(top_padding)
17 1
        pdf.table(technical_skills(content), properties)
18
      end
19 1
      private_class_method :generate_table
20
21 1
      def technical_skills(content)
22 1
        content[:skills].reduce([]) do |entries, (title, entry)|
23 8
          entries << [title, entry]
24
        end
25
      end
26 1
      private_class_method :technical_skills
27
    end
28
  end
29
end
30