Passed
Push — master ( 694e2f...150a8e )
by Dean
09:10 queued 06:18
created

Description.__init__()   A

Complexity

Conditions 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
ccs 3
cts 3
cp 1
rs 10
cc 1
crap 1
1 1
class Description(object):
2 1
    def __init__(self, description, options):
3 1
        self.description = description
4 1
        self.options = options
5
6 1
    def build(self):
7
        sections = []
8
9
        if self.description:
10
            sections.append(self.description)
11
12
        if self.options:
13
            sections.append("\n".join([
14
                "| | |",
15
                "|-|-|",
16
                "\n".join([
17
                    "| **%s** | %s |" % option
18
                    for option in self.options
19
                ])
20
            ]))
21
22
        return "\n\n".join(sections)
23